[SailfishDevel] ConfigurationValue default path
Martin Kampas
martin.kampas at jolla.com
Mon May 21 05:00:03 UTC 2018
Hi João,
I think you need ConfigurationGroup instead of ConfigurationValue if you want to use it this way, and I am unsure that it is supposed to work with alias properties.
BR,
Martin
________________________________
From: Devel [devel-bounces at lists.sailfishos.org] on behalf of joao morgado via Devel [devel at lists.sailfishos.org]
Sent: Monday, May 21, 2018 6:45 AM
To: Sailfish OS Developers
Subject: Re: [SailfishDevel] ConfigurationValue default path
Hi Martin
Thanks for your replay.
I did a very small example, trying to save a rectangle color, but if fails. When starting, it's always red. Am I missing something ?
Rectangle {
id: mycolor
color: "red"
//color: mysettings.saveColor
anchors.fill: parent
MouseArea {
anchors.fill: parent
onClicked: {
mycolor.color = Qt.colorEqual(mycolor.color, "red") ? "blue" : "red"
hello === "I'm red" ? hello = "I'm blue" : hello = "I'm red"
}
}
Text {
text: hello
}
}
property string hello: "I'm red"
ConfigurationValue {
id: mysettings
property alias saveColor: mycolor.color
property alias mystring: page.hello
//property color saveColor: "red"
}
/*Component.onCompleted: console.log("initial color: "+mysettings.saveColor)
Component.onDestruction: {
mysettings.saveColor = mycolor.color
console.log("destruction color: "+mysettings.saveColor)
}*/
Cheers
João
Em sexta-feira, 18 de maio de 2018 06:04:27 GMT+1, Martin Kampas <martin.kampas at jolla.com> escreveu:
Hi João,
The storage backend is dconf https://wiki.gnome.org/Projects/dconf
BR,
Martin
________________________________
From: Devel [devel-bounces at lists.sailfishos.org] on behalf of joao morgado via Devel [devel at lists.sailfishos.org]
Sent: Friday, May 18, 2018 6:54 AM
To: devel at lists.sailfishos.org
Subject: [SailfishDevel] ConfigurationValue default path
Hi
Where does ConfigurationValue saves the data ? I didnt find nothing in "/home/nemo/.config" related to my app.
In desktop and android I sucessfully used the equivalent qml Settings to save my stuff, but in sailfish nothing is being saved using ConfigurationValue.
Cheers
João
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20180521/30f3339c/attachment-0001.html>
More information about the Devel
mailing list