[SailfishDevel] Saving state/config

Thomas Tanghus thomas at tanghus.net
Fri Nov 15 14:13:19 UTC 2013


On Friday 15 November 2013 05:44 Jonni Rainisto wrote:
> Hi,
> 
> Normal usage of QSettings which saves under /home/nemo/.config/app would be
> just fine for C++. If you just want to save few config values in QML, then
> you might want to use GConf by importing nemo-qml-plugin-configuration
> module (https://github.com/nemomobile/nemo-qml-plugin-configuration) and
> use config key like com/yourdomain/applicationname etc.
> 
> For example:
> --
> import org.nemomobile.configuration 1.0
> 
> Page {
>     ConfigurationValue {
>         id: your_foo_setting
>         key: "/com/super/superapplication/light_value"
>         defaultValue: "-1"
>     }
> --
> re, Jonni

Thanks Jonni, just the simple approach I needed :)

I only started on using QML the other night, so not clear on how it works. Am 
I right to assume that I can then access that setting by id to set a new value 
which will be saved automatically?

Like:

    your_foo_setting.setValue(newValue);

> [thomas at tanghus.net] Sent: Friday, November 15, 2013 3:13 AM
> I couldn't find any standard way of saving an apps config. Is there such a
> standard, or is it up to the developer to choose format and location?
> 

-- 
Med venlig hilsen / Best Regards

Thomas Tanghus


More information about the Devel mailing list