Qt 4.8
Public Functions | Properties | List of all members
Maemo::GConfItemFast Class Reference

Public Functions

 GConfItemFast (const QString &k)
 
QHash< QString, QVariantgetEntries () const
 

Properties

QString key
 

Detailed Description

Definition at line 106 of file proxyconf.cpp.

Constructors and Destructors

◆ GConfItemFast()

Maemo::GConfItemFast::GConfItemFast ( const QString k)
inline

Definition at line 108 of file proxyconf.cpp.

108 : key(k) {}

Functions

◆ getEntries()

QHash< QString, QVariant > Maemo::GConfItemFast::getEntries ( ) const

Definition at line 118 of file proxyconf.cpp.

Referenced by GConfItemFast(), Maemo::getHttpValues(), and Maemo::getValues().

119 {
120  QHash<QString,QVariant> children;
121 
122  withClient(client) {
123  QByteArray k = key.toUtf8();
124  GSList *entries = gconf_client_all_entries(client, k.data(), NULL);
125  for (GSList *e = entries; e; e = e->next) {
126  char *key_name = strrchr(((GConfEntry *)e->data)->key, '/');
127  if (!key_name)
128  key_name = ((GConfEntry *)e->data)->key;
129  else
130  key_name++;
131  QString key(convertKey(key_name));
132  QVariant value = convertValue(((GConfEntry *)e->data)->value);
133  gconf_entry_unref((GConfEntry *)e->data);
134  //qDebug()<<"key="<<key<<"value="<<value;
135  children.insert(key, value);
136  }
137  g_slist_free (entries);
138  }
139 
140  return children;
141 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
Definition: qstring.cpp:4074
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define withClient(c)
Definition: proxyconf.cpp:115
static QVariant convertValue(GConfValue *src)
Definition: proxyconf.cpp:64
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
static QString convertKey(const char *key)
Definition: proxyconf.cpp:59
static const MacSpecialKey entries[NumEntries]

Properties

◆ key

QString Maemo::GConfItemFast::key
private

Definition at line 112 of file proxyconf.cpp.

Referenced by getEntries().


The documentation for this class was generated from the following file: