[SailfishDevel] Saving state/config
Jonni Rainisto
jonni.rainisto at jolla.com
Fri Nov 15 05:44:58 UTC 2013
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
________________________________________
From: devel-bounces at lists.sailfishos.org [devel-bounces at lists.sailfishos.org] on behalf of Thomas Tanghus [thomas at tanghus.net]
Sent: Friday, November 15, 2013 3:13 AM
To: Sailfish OS Developers
Subject: [SailfishDevel] Saving state/config
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?
I'm making a *very* simple app, so only using QML/JS, and only have to save
3-4 values.
As far as I could see the location should be /home/nemo/.config/appname[.ext]
which could probably be accomplished better using
QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) but is that
possible in QML?
And which format should it be in?
--
Med venlig hilsen / Best Regards
Thomas Tanghus
_______________________________________________
SailfishOS.org Devel mailing list
More information about the Devel
mailing list