Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Settings Class Reference

#include </tmp/quassel/src/common/settings.h>

Inheritance diagram for Settings:

Public Types

enum  Mode { Default, Custom }

Public Member Functions

virtual void notify (const QString &key, QObject *receiver, const char *slot)
 Call the given slot on change of the given key.
void initAndNotify (const QString &key, QObject *receiver, const char *slot, const QVariant &defaultValue=QVariant())
 Sets up notification and calls the given slot to set the initial value.
virtual uint version ()

Protected Member Functions

 Settings (QString group_, QString appName_)
virtual ~Settings ()
void setGroup (const QString &group_)
virtual QStringList allLocalKeys ()
virtual QStringList localChildKeys (const QString &rootkey=QString())
virtual QStringList localChildGroups (const QString &rootkey=QString())
virtual void setLocalValue (const QString &key, const QVariant &data)
virtual const QVariant & localValue (const QString &key, const QVariant &def=QVariant())
virtual void removeLocalKey (const QString &key)

Protected Attributes

QString group
QString appName

Private Member Functions

QSettings::Format format ()
QString fileName ()
QString normalizedKey (const QString &group, const QString &key)
void setCacheValue (const QString &normKey, const QVariant &data)
const QVariant & cacheValue (const QString &normKey)
bool isCached (const QString &normKey)
SettingsChangeNotifiernotifier (const QString &normKey)
bool hasNotifier (const QString &normKey)

Static Private Attributes

static QHash< QString, QVariant > settingsCache
static QHash< QString,
SettingsChangeNotifier * > 
settingsChangeNotifier

Detailed Description

Definition at line 44 of file settings.h.

Member Enumeration Documentation

enum Mode
Enumerator:
Default 
Custom 

Definition at line 47 of file settings.h.

Constructor & Destructor Documentation

Settings ( QString  group_,
QString  appName_ 
)
inlineprotected

Definition at line 59 of file settings.h.

virtual ~Settings ( )
inlineprotectedvirtual

Definition at line 60 of file settings.h.

Member Function Documentation

void initAndNotify ( const QString &  key,
QObject *  receiver,
const char *  slot,
const QVariant &  defaultValue = QVariant() 
)
uint version ( )
virtual

Definition at line 75 of file settings.cpp.

References create_qsettings, and VERSION.

Referenced by Core::Core(), and QtUiApplication::init().

void setGroup ( const QString &  group_)
inlineprotected

Definition at line 62 of file settings.h.

References group.

QStringList allLocalKeys ( )
protectedvirtual

Definition at line 89 of file settings.cpp.

References create_qsettings, and group.

Referenced by ShortcutSettings::clear().

QStringList localChildKeys ( const QString &  rootkey = QString())
protectedvirtual
QStringList localChildGroups ( const QString &  rootkey = QString())
protectedvirtual
void setLocalValue ( const QString &  key,
const QVariant &  data 
)
protectedvirtual

Definition at line 131 of file settings.cpp.

References create_qsettings, group, hasNotifier(), normalizedKey(), notifier(), setCacheValue(), and SettingsChangeNotifier::valueChanged().

Referenced by BufferSettings::enableUserStateIcons(), ChatViewSettings::enableWebPreview(), BufferSettings::filterMessage(), BufferSettings::removeFilter(), ShortcutSettings::saveShortcut(), CoreAccountSettings::setAccountValue(), TabCompletionSettings::setAddSpaceMidSentence(), CoreAccountSettings::setAutoConnectAccount(), CoreAccountSettings::setAutoConnectOnStartup(), CoreAccountSettings::setAutoConnectToFixedAccount(), CoreConnectionSettings::setAutoReconnect(), TabCompletionSettings::setCaseSensitivity(), TabCompletionSettings::setCompletionSuffix(), CoreSettings::setCoreState(), UiStyleSettings::setCustomFormat(), BacklogSettings::setDynamicBacklogAmount(), BufferSettings::setErrorMsgsTarget(), BacklogSettings::setFixedBacklogAmount(), BacklogSettings::setGlobalUnreadBacklogAdditional(), BacklogSettings::setGlobalUnreadBacklogLimit(), NotificationSettings::setHighlightList(), NotificationSettings::setHighlightNick(), CoreAccountSettings::setLastAccount(), BufferSettings::setMessageFilter(), CoreConnectionSettings::setNetworkDetectionMode(), NotificationSettings::setNicksCaseSensitive(), BacklogSettings::setPerBufferUnreadBacklogAdditional(), BacklogSettings::setPerBufferUnreadBacklogLimit(), CoreConnectionSettings::setPingTimeoutInterval(), CoreConnectionSettings::setReconnectInterval(), BacklogSettings::setRequesterType(), BufferSettings::setServerNoticesTarget(), CoreUserSettings::setSessionState(), CoreUserSettings::setSessionValue(), WarningsSettings::setShowWarning(), TabCompletionSettings::setSortMode(), CoreSettings::setStorageSettings(), ChatViewSettings::setTimestampFormatString(), TabCompletionSettings::setUseLastSpokenTo(), BufferSettings::setUserNoticesTarget(), UiSettings::setValue(), BufferSettings::setValue(), SessionSettings::setValue(), NotificationSettings::setValue(), ChatViewSettings::setWebSearchUrlFormatString(), CoreAccountSettings::storeAccountData(), and CoreUserSettings::storeIdentity().

const QVariant & localValue ( const QString &  key,
const QVariant &  def = QVariant() 
)
protectedvirtual

Definition at line 143 of file settings.cpp.

References cacheValue(), create_qsettings, group, isCached(), normalizedKey(), and setCacheValue().

Referenced by CoreAccountSettings::accountValue(), TabCompletionSettings::addSpaceMidSentence(), CoreAccountSettings::autoConnectAccount(), CoreAccountSettings::autoConnectOnStartup(), CoreAccountSettings::autoConnectToFixedAccount(), CoreConnectionSettings::autoReconnect(), TabCompletionSettings::caseSensitivity(), TabCompletionSettings::completionSuffix(), CoreSettings::coreState(), UiStyleSettings::customFormat(), ItemViewSettings::displayTopicInTooltip(), BacklogSettings::dynamicBacklogAmount(), BufferSettings::errorMsgsTarget(), BufferSettings::filterMessage(), BacklogSettings::fixedBacklogAmount(), BacklogSettings::globalUnreadBacklogAdditional(), BacklogSettings::globalUnreadBacklogLimit(), BufferSettings::hasFilter(), NotificationSettings::highlightList(), NotificationSettings::highlightNick(), CoreUserSettings::identity(), initAndNotify(), CoreAccountSettings::lastAccount(), ShortcutSettings::loadShortcut(), BufferSettings::messageFilter(), ItemViewSettings::mouseWheelChangesBuffer(), CoreConnectionSettings::networkDetectionMode(), NotificationSettings::nicksCaseSensitive(), CoreSettings::oldDbSettings(), BacklogSettings::perBufferUnreadBacklogAdditional(), BacklogSettings::perBufferUnreadBacklogLimit(), CoreConnectionSettings::pingTimeoutInterval(), CoreConnectionSettings::reconnectInterval(), BacklogSettings::requesterType(), CoreAccountSettings::retrieveAccountData(), BufferSettings::serverNoticesTarget(), SessionSettings::sessionAge(), CoreUserSettings::sessionData(), CoreUserSettings::sessionState(), CoreUserSettings::sessionValue(), BufferSettings::showUserStateIcons(), WarningsSettings::showWarning(), ChatViewSettings::showWebPreview(), TabCompletionSettings::sortMode(), CoreSettings::storageSettings(), ChatViewSettings::timestampFormatString(), TabCompletionSettings::useLastSpokenTo(), BufferSettings::userNoticesTarget(), UiSettings::value(), BufferSettings::value(), SessionSettings::value(), NotificationSettings::value(), and ChatViewSettings::webSearchUrlFormatString().

QSettings::Format format ( )
inlineprivate

Definition at line 77 of file settings.h.

Referenced by fileName().

QString fileName ( )
inlineprivate

Definition at line 87 of file settings.h.

References appName, Quassel::configDirPath(), and format().

QString normalizedKey ( const QString &  group,
const QString &  key 
)
inlineprivate

Definition at line 97 of file settings.h.

Referenced by initAndNotify(), localValue(), notify(), removeLocalKey(), and setLocalValue().

void setCacheValue ( const QString &  normKey,
const QVariant &  data 
)
inlineprivate

Definition at line 105 of file settings.h.

References settingsCache.

Referenced by localValue(), and setLocalValue().

const QVariant& cacheValue ( const QString &  normKey)
inlineprivate

Definition at line 111 of file settings.h.

References settingsCache.

Referenced by localValue().

bool isCached ( const QString &  normKey)
inlineprivate

Definition at line 117 of file settings.h.

References settingsCache.

Referenced by localValue(), and removeLocalKey().

SettingsChangeNotifier* notifier ( const QString &  normKey)
inlineprivate

Definition at line 123 of file settings.h.

References hasNotifier(), and settingsChangeNotifier.

Referenced by initAndNotify(), notify(), and setLocalValue().

bool hasNotifier ( const QString &  normKey)
inlineprivate

Definition at line 131 of file settings.h.

References settingsChangeNotifier.

Referenced by notifier(), and setLocalValue().

Member Data Documentation

QString group
protected
QString appName
protected

Definition at line 74 of file settings.h.

Referenced by fileName().

QHash< QString, QVariant > settingsCache
staticprivate

Definition at line 94 of file settings.h.

Referenced by cacheValue(), isCached(), removeLocalKey(), and setCacheValue().

QHash< QString, SettingsChangeNotifier * > settingsChangeNotifier
staticprivate

Definition at line 95 of file settings.h.

Referenced by hasNotifier(), and notifier().


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