MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

GConfItem Class Reference

Simple C++ wrapper for GConf. More...

Inheritance diagram for GConfItem:
QObject

List of all members.

Signals

void  valueChanged ()

Public Member Functions

  GConfItem (const QString &key, QObject *parent=0)
virtual  ~GConfItem ()
QString  key () const
QVariant  value () const
QVariant  value (const QVariant &def) const
void  set (const QVariant &val)
void  unset ()
QList< QString listDirs () const
QList< QString listEntries () const

Detailed Description

Simple C++ wrapper for GConf.


Constructor & Destructor Documentation

GConfItem::GConfItem ( const QString key,
QObject parent = 0  
) [explicit]

Initializes a GConfItem to access the GConf key denoted by key. Key names should follow the normal GConf conventions like "/myapp/settings/first".

Parameters:
key  The name of the key.
parent  Parent object
GConfItem::~GConfItem (  )  [virtual]

Finalizes a GConfItem.


Member Function Documentation

QString GConfItem::key (  )  const

Returns the key of this item, as given to the constructor.

QList< QString > GConfItem::listDirs (  )  const

Return a list of the directories below this item. The returned strings are absolute key names like "/myapp/settings".

A directory is a key that has children. The same key might also have a value, but that is confusing and best avoided.

QList< QString > GConfItem::listEntries (  )  const

Return a list of entries below this item. The returned strings are absolute key names like "/myapp/settings/first".

A entry is a key that has a value. The same key might also have children, but that is confusing and is best avoided.

void GConfItem::set ( const QVariant val  ) 

Set the value of this item to val. If val can not be represented in GConf or GConf refuses to accept it for other reasons, the current value is not changed and nothing happens.

When the new value is different from the old value, the changedValue() signal is emitted on this GConfItem as part of calling set(), but other GConfItem:s for the same key do only receive a notification once the main loop runs.

Parameters:
val  The new value.
void GConfItem::unset (  ) 

Unset this item. This is equivalent to

        item.set(QVariant(QVariant::Invalid));
QVariant GConfItem::value (  )  const

Returns the current value of this item, as a QVariant.

QVariant GConfItem::value ( const QVariant def  )  const

Returns the current value of this item, as a QVariant. If there is no value for this item, return def instead.

void GConfItem::valueChanged (  )  [signal]

Emitted when the value of this item has changed.


(C) 2009 Nokia Corporation.
LGPL Lesser General Public License
MeeGo 1.2 Harmattan API