Signals | Public Member Functions | Protected Member Functions

QctSettings Class Reference

#include <settings.h>

List of all members.

Signals

void valuesChanged (const QHash< QString, QVariant > &changedSettings)
 emitted if some of the values changed, settings contains all changed settings with the new values.

Public Member Functions

virtual ~QctSettings ()
 calls sync() before deconstruction.
void setLocalPhoneNumberLength (int length)
 sets the length of the local part of the phone number
void setConcurrencyLevel (int concurrencyLevel)
void setAvatarSize (int avatarSize)
 sets the default size of the avatar image, which is square, in count of pixels
void setNameOrder (const QString &nameOrder)
void setGuidAlgorithmName (const QString &algorithmName)
 sets the algorithm to be used for Guid creation
void setLastMSISDN (const QString &msisdn)
 ?
void setSparqlBackends (const QStringList &backends)
 sets the SPARQL-backends used by the Tracker backend to QtContacts
void sync ()
 does immediate synchronisation with the storage system, instead of automatically only after some timeout.

Protected Member Functions

void setValue (const QString &key, const QVariant &value)
 stores value for setting key
QVariant value (const QString &key) const
 returns the current value of the settings key
Q_DECL_DEPRECATED QVariant value (const QString &key, const QVariant &defaultValue) const
void registerSetting (const QString &key, const QVariant &defaultValue=QVariant())
 registers key as used, so it is regarded if looking for changes in the storage

Detailed Description

QctSettings wraps the storage of basic settings used by the Tracker backend to QtContacts. There can be multiple instances of QctSettings and its subclasses, they share the internal settings engine. To get informed to changes to the settings, connect to the signal

 valuesChanged(QHash<QString,QVariant>) 

. and test if settings your code is interested in are part of the changed values and read the new value

 void Handler::onSettingsChanged(const QHash<QString,QVariant> &changedSettings)
 {
     QHash<QString,QVariant>::ConstIterator it = changedSettings.find(someSettingKey);
     if (it != changedSettings.constEnd()) {
         QVariant newValue = it.value();
 [...]

Subclasses of QctSettings need to register all settings in the constructor of the subclass, calling

 registerSetting(key, defaultValue); 

for each.


Member Function Documentation

void QctSettings::setConcurrencyLevel ( int  concurrencyLevel  ) 

sets the number of parallel threads to be used by the Tracker backend to QtContacts TODO: development setting only?

void QctSettings::setNameOrder ( const QString &  nameOrder  ) 

sets the order of firstname and lastname in the displaylabel, cmp. QContactDisplayLabel__FieldOrderFirstName and QContactDisplayLabel__FieldOrderLastName

Q_DECL_DEPRECATED QVariant QctSettings::value ( const QString &  key,
const QVariant &  defaultValue 
) const [protected]
Deprecated:
: defaultvalue needs to be set with registerSetting() instead

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