Hi,

Yes its as simple as assign a new value and it will be automaticly stored.

your_foo_setting.value = newValue

But having said that, I'm not sure what is the store's current intake QA rules, 
it might be that configuration plugin is not whitelisted yet. So you might need 
to use QSettings if you want to be in store. For devel projects that plugin is 
easy and lightweight to use.

re, Jonni
________________________________________
From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Thomas Tanghus [tho...@tanghus.net]
Sent: Friday, November 15, 2013 4:13 PM
To: Sailfish OS Developers
Subject: Re: [SailfishDevel] Saving state/config

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);

> [tho...@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
_______________________________________________
SailfishOS.org Devel mailing list
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to