GConfItem is a simple C++ wrapper for GConf.
Creating a GConfItem instance gives you access to a single GConf key. You can get and set its value, and connect to its valueChanged() signal to be notified about changes.
The value of a GConf key is returned to you as a QVariant, and you pass in a QVariant when setting the value. GConfItem converts between a QVariant and GConf values as needed, and according to the following rules:
- A QVariant of type QVariant::Invalid denotes an unset GConf key.
- QVariant::Int, QVariant::Double, QVariant::Bool are converted to and from the obvious equivalents.
- QVariant::String is converted to/from a GConf string and always uses the UTF-8 encoding. No other encoding is supported.
- QVariant::StringList is converted to a list of UTF-8 strings.
- QVariant::List (which denotes a QList<QVariant>) is converted to/from a GConf list. All elements of such a list must have the same type, and that type must be one of QVariant::Int, QVariant::Double, QVariant::Bool, or QVariant::String. (A list of strings is returned as a QVariant::StringList, however, when you get it back.)
- Any other QVariant or GConf value is essentially ignored.
- Warning:
- GConfItem is as thread-safe as GConf.
(C) 2009 Nokia Corporation.
LGPL Lesser General Public License |
MeeGo 1.2 Harmattan API
|