Active Settings refactoring done & merged now

Sebastian Kügler sebas at kde.org
Wed Jan 4 00:14:39 UTC 2012


Hej,

> > I've moved and refactored most of the guts of Active Settings into its own
> > plugin (in plasma-mobile/components/settings, exported as
> > org.kde.active.settings. (If that's not a good name to export, we'd better
> > change it now.) Code is currently in the sebas/settingscomponent branch in
> > the plasma-mobile git repo. From my POV, I'm planning to move this into
> > master if nobody screams.
> 
> +1 for me, a thing that could be done is to review the public api that goes
> in  the import

That should be fairly easy, at least for the bits we /want/ others to use:

SettingsItem
	- is-a PageStack
	- QString module as the only interesting property, takes a plugin name

ConfigGroup
	- readEntry(name, defaultvalue)
	- writeEntry(name, value)
	- QString file property
	- QString group property
	- QStringList keyList property *1)

Using the org.kde.active.settings import, of course one can also get access to 
the objects that are more internal, but need to be registered to the QML 
runtime (SettingsComponent for example). Is there a way to hide them from the 
public API?

*1) I've just added this, and made the ConfigTest module use this one, it 
seems all we need, so I got rid of the ConfigModel object (is-a QAIM). 
ConfigGroup is directly derived from QObject, so much lighter.

Nested group support isn't there yet. I was thinking of maybe an API like 
this:

ConfigGroup {
	file: "examplerc"
	group: "topLevelGroup"
	ConfigGroup {
		id: myConfigGroup
		group: "secondLevelGroup"
	}
}

and then elsewhere:

onTextChanged: myConfigGroup.readEntry("myKey", "default value");

So the nesting is actually defined by the structure, this feels nicely 
declarative (modulo the lack of notifiable properties). It could be done by 
trying to cast the parent of the ConfigGroup to KConfigGroup (or Base), and 
then using that as parent group. In theory. What do you think?

All the rest is merged into master, let me know if anything doesn't work.

Cheers,
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Active mailing list