Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nemo-qml-plugin-configuration] Add a ConfigurationGroup type. #2

Merged
merged 1 commit into from May 7, 2014

Conversation

adenexter
Copy link
Contributor

This provides a convenient API for getting and setting multiple
properties under a common key path.

Properties declared in a ConfigurationGroup are populated with values from the store, and values subsequently assigned to the the property are written back to the store. Groups can also be nested to access hierarchical structures.

ConfigurationGroup {
path: "/path/to/my/settings"
property int myIntegerProperty: 5
property string myStringProperty: "hello world"

ConfigurationGroup {
    path: "nested"
    property real myNestedProperty: 0.3
}

}

@@ -19,10 +19,19 @@ Source100: nemo-qml-plugin-configuration-qt5.yaml
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(mlite5)
BuildRequires: pkgconfig(gconf-2.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We most likely don't want to do this. In the longer term, migrating away from gconf would be a good thing. dconf provides similar benefits (notification of changes etc) with a much, much better read performance, which is why I was careful to remove gconf-specific behavior from MGConfItem to allow us to switch the backend mostly seamlessly to UI code later on.

If you can figure out a way to hide this in MGConfItem (or somewhere near it, so the switching is easier) and make sure that we can do it with dconf, then I'd be happy to see it in. The API is useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really think porting a second package is going to be more of a maintenance burden than splitting the implementation between two packages?

I guess I could add an MGConfGroup type to mlite though and extend that from the plugin. The concept and implementation are just as applicable to C++ types and it'd be a good way to remove a lot of boiler plate from types like the silica theme object.

@adenexter
Copy link
Contributor Author

The implementation has moved to mlite nemomobile/mlite#4

This now just provides qml plugin registration.

@adenexter
Copy link
Contributor Author

The G's have changed to D's and the mlite dependency is now nemomobile/mlite#12

This provides a convenient API for getting and setting multiple
properties under a common key path.
@tanty
Copy link

tanty commented May 5, 2014

LGTM

foolab added a commit that referenced this pull request May 7, 2014
[nemo-qml-plugin-configuration] Add a ConfigurationGroup type.
@foolab foolab merged commit f49af11 into nemomobile:master May 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants