mandag den 29. juli 2013 skrev PCMan :
Hello,
To see how dconf works and make our evalation easier, I created a
simple class providing the same interface as QSettings, but uses dconf
internally.

It's a reusable C++ class - LxQt::Settings, a drop in replacement for
QSettings based on dconf.

https://github.com/PCMan/lxqt-settings

It's a proof of concept. I only implement a subset of QSettings methods.
Besides, I haven't implement change notifications, either. (QSettings
IIRC does not support this)
Data stored are all strings, just like what QSettings stores in ini files.
However, dconf actually supports more data formats than string.
So, there are still rooms to improve this rough implementation.

I did not use glib GSettings since we do not need the features it
provides. So I call low level dconf client API instead.

main.cpp domonstrated how to use the class.
It's just like QSettings.

Comments are wanted.

Looks good to me. 

I was pondering a different approach: Looking at the source code for QSettings one can see that QSettings keeps an instance of the abstract class QPrivateSettings that handles communication with the backend. By choosing a concrete subclass such as QConfFileSettings or QWinSettings QSettings can chose the backend (ini-files or windows-registry).
So I thought that if we could make a subclass of QPrivateSettings for dconf and inject it into a QSettings instance, we'd be good to go. 
However this has the problem of relying on QPrivateSettings, which is marked as not intended for external use. So your approach is best I think.

lxqt-settings will probably need to emit a signal when settings change. RazorSettings, which work on top of QSettings, sets up filewatchers to be able to emit signals on change, and this won't work anymore.

br. Chr.

 
Thanks!

--
--
You received this message because you are subscribed to the Google
Groups "Razor-qt" group.
For more options, visit this group at
http://groups.google.com/group/razor-qt?hl=en

---
You received this message because you are subscribed to the Google Groups "Razor-qt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to razor-qt+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.