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

#include <iapconf.h>

Public Functions

 IAPConf (const QString &iap_id)
 
QVariant value (const QString &key) const
 
virtual ~IAPConf ()
 

Static Public Functions

static void getAll (QList< QString > &all_iaps, bool return_path=false)
 

Properties

IAPConfPrivated_ptr
 

Detailed Description

Definition at line 52 of file iapconf.h.

Constructors and Destructors

◆ IAPConf()

Maemo::IAPConf::IAPConf ( const QString iap_id)

Definition at line 197 of file iapconf.cpp.

198  : d_ptr(new IAPConfPrivate)
199 {
200  d_ptr->settings = conn_settings_open(CONN_SETTINGS_CONNECTION,
201  QSTRING_TO_CONST_CSTR(iap_id));
202  if (d_ptr->settings == 0) {
203  qWarning("IAPConf: Unable to open ConnSettings for %s",
204  QSTRING_TO_CONST_CSTR(iap_id));
205  }
206 }
ConnSettings * settings
Definition: iapconf.cpp:56
Q_CORE_EXPORT void qWarning(const char *,...)
#define QSTRING_TO_CONST_CSTR(str)
Definition: iapconf.cpp:49
IAPConfPrivate * d_ptr
Definition: iapconf.h:69

◆ ~IAPConf()

Maemo::IAPConf::~IAPConf ( )
virtual

Definition at line 208 of file iapconf.cpp.

209 {
210  conn_settings_close(d_ptr->settings);
211  delete d_ptr;
212 }
ConnSettings * settings
Definition: iapconf.cpp:56
IAPConfPrivate * d_ptr
Definition: iapconf.h:69

Functions

◆ getAll()

void Maemo::IAPConf::getAll ( QList< QString > &  all_iaps,
bool  return_path = false 
)
static

Return all the IAPs found in the system. If return_path is true, then do not strip the IAP path away.

Definition at line 226 of file iapconf.cpp.

Referenced by QIcdEngine::doRequestUpdate().

227 {
228  Q_UNUSED(return_path); // We don't use return path currently
229 
230  // Go through all available connections and add them to the list
231  char **ids = conn_settings_list_ids(CONN_SETTINGS_CONNECTION);
232  if (ids == 0) {
233  // No ids found - nothing to do
234  return;
235  }
236 
237  for (int idx = 0; ids[idx]; idx++) {
238  all_iaps.append(QString(ids[idx]));
239  free(ids[idx]);
240  }
241  free(ids);
242 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ value()

QVariant Maemo::IAPConf::value ( const QString key) const

Get one IAP value.

Definition at line 215 of file iapconf.cpp.

Referenced by QIcdEngine::addConfiguration(), QIcdEngine::doRequestUpdate(), getNetworkAttrs(), QNetworkSessionPrivateImpl::stateChange(), and QNetworkSessionPrivateImpl::syncStateWithInterface().

216 {
217  ConnSettingsValue *val = conn_settings_get(d_ptr->settings,
218  QSTRING_TO_CONST_CSTR(key));
219 
221  conn_settings_value_destroy(val);
222  return variant;
223 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QVariant valueToVariant(ConnSettingsValue *value)
Definition: iapconf.cpp:134
ConnSettings * settings
Definition: iapconf.cpp:56
#define QSTRING_TO_CONST_CSTR(str)
Definition: iapconf.cpp:49
const char * variant
IAPConfPrivate * d_ptr
Definition: iapconf.h:69

Properties

◆ d_ptr

IAPConfPrivate* Maemo::IAPConf::d_ptr
private

Definition at line 69 of file iapconf.h.

Referenced by IAPConf(), value(), and ~IAPConf().


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