[glideplan_swproj] Re: [glideplan_swproj] Re: Settings file format

  • From: Tomáš Zámečník <pulcik@xxxxxxxx>
  • To: glideplan_swproj@xxxxxxxxxxxxx
  • Date: Sun, 22 Jan 2012 19:19:16 +0100 (CET)

I agree with Bohdan, saving to file is good enough.
If you save settings during closing dialog (or on pushing some apply button) 
they wouldn't be lost in case of crash.
Pressing the Ok or Apply button means "I have finished my changes", so it is 
the right moment for saving them.

T.

> ------------ Původní zpráva ------------
> Od: Bohdan Maslowski <bohdan.maslowski@xxxxxxxxx>
> Předmět: [glideplan_swproj] Re: Settings file format
> Datum: 22.1.2012 18:55:21
> ----------------------------------------
> What is Copy-read-update paradigm?
>
> I think the simple solution is to load the settings into memory, and write
> them back when the app exits or when settings dialog is closed.. If the
> application crashes, changes to the settings will be lost, but I don't
> think that is a big issue.
>
> Regarding SQLite - I think it would be nice to have all user data in a
> database, including imported layers, settings, history etc., but since we
> are already using filesystem for half of the things, maybe i'd just stick
> to xml...
>
> Bohdan
>
> 2012/1/22 Cestmir Houska <czestmyr@xxxxxxxxx>
>
> > Another thought:
> >
> > XML is not at all suitable for Copy-read-update paradigm, which will
> > most definitely be used with settings. Workaround could be to read the
> > data from XML at the start of the application and write them back when
> > the app quits. However, this does not work when the application
> > crashes in the middle of execution. What about resurrecting the idea
> > with SQLite? Qt seems to have built-in support for it. The only
> > disadvantage of using SQLite is that if the user totally screws his
> > settings up (like setting PI to 2.14) and the application fails to
> > load, there will be no way of restoring his settings (other than
> > deleting the whole settings database file).
> >
> > Any thoughts?
> >
> > Cestmir
> >
> > 2012/1/22 Cestmir Houska <czestmyr@xxxxxxxxx>:
> > > Ok guys,
> > >
> > > you persuaded me. I will use XML. It is true that by using built-in
> > > XML support in Qt, everything will be much simpler than writing our
> > > own parser. This is the main argument that made me change my mind.
> > >
> > > Cestmir
> > >
> > > 2012/1/22 Tomáš Zámečník <pulcik@xxxxxxxx>:
> > >> I am fox xml too.
> > >> We will also have ini file. (But there is written only the path to data
> > directory (where the settings file is stored))
> > >> T.
> > >>
> > >>> ------------ Původní zpráva ------------
> > >>> Od: Bohdan Maslowski <bohdan.maslowski@xxxxxxxxx>
> > >>> Předmět: [glideplan_swproj] Re: Settings file format
> > >>> Datum: 21.1.2012 20:08:10
> > >>> ----------------------------------------
> > >>> Hi!
> > >>>
> > >>> I think xml is a better choice. Some arguments:
> > >>>
> > >>> - no need to write a parser
> > >>> - everyone knows the syntax
> > >>> - easy validation
> > >>>
> > >>> Users probably won't be editing the settings file directly anyway.
> > >>>
> > >>> Also, there is a third choice: ini files. But still, xml is better in
> > case
> > >>> we need to save structured or binary data sometime.
> > >>>
> > >>> Bohdan
> > >>>
> > >>> On Sat, Jan 21, 2012 at 7:13 PM, Cestmir Houska <czestmyr@xxxxxxxxx>
> > wrote:
> > >>>
> > >>> > Hi everyone!
> > >>> >
> > >>> > I am about to start working on saving and loading the settings from a
> > >>> > file. The question on everyone is now:
> > >>> >
> > >>> > Which file format would you prefer for settings? XML or our own
> > format?
> > >>> >
> > >>> > This problem might seem unimportant, but starts to gain significance
> > >>> > as soon as one wants to edit the settings via a text editor, which
> > >>> > might sometimes be useful. I personally am for our own format,
> > because
> > >>> > XML can be often cumbersome and ugly.
> > >>> >
> > >>> > Cestmir
> > >>> >
> > >>> > To visit archive or unsubscribe, follow:
> > >>> > http://www.freelists.org/list/glideplan_swproj
> > >>> >
> > >>>
> > >>>
> > >>>
> > >>
> > >> To visit archive or unsubscribe, follow:
> > >> http://www.freelists.org/list/glideplan_swproj
> >
> > To visit archive or unsubscribe, follow:
> > http://www.freelists.org/list/glideplan_swproj
> >
>
>
>

To visit archive or unsubscribe, follow:
http://www.freelists.org/list/glideplan_swproj

Other related posts: