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-boun...@lists.sailfishos.org] on behalf of joao morgado via 
Devel [devel@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.kam...@jolla.com> escreveu:


Hi João,

The storage backend is dconf https://wiki.gnome.org/Projects/dconf

BR,
Martin

________________________________
From: Devel [devel-boun...@lists.sailfishos.org] on behalf of joao morgado via 
Devel [devel@lists.sailfishos.org]
Sent: Friday, May 18, 2018 6:54 AM
To: devel@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



_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to