X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsettings.h;h=fcf9cd5b74af40e7b9b20d5f558737d600013882;hp=f2e0d384fbd2c962f190c5fbf981f70f3689d39f;hb=9ac6ae4ee26819874d8843ba09f38a24088d663d;hpb=077d44f36d2f5c730283ef6be839aea7dd073d56 diff --git a/src/common/settings.h b/src/common/settings.h index f2e0d384..fcf9cd5b 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-07 by The Quassel Team * + * Copyright (C) 2005-07 by the Quassel IRC Team * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -21,27 +21,40 @@ #ifndef _SETTINGS_H_ #define _SETTINGS_H_ -#include +#include +#include +#include -class Settings { +class Settings : private QSettings { public: - //Settings(); - //~Settings(); - static void init(); - static void setProfile(const QString &string); - static QString profile(); + virtual ~Settings(); - static void setGuiValue(const QString &key, const QVariant &value); - static QVariant guiValue (const QString &key, const QVariant &defaultValue = QVariant()); - static void setCoreValue(const QString &user, const QString &key, const QVariant &value); - static QVariant coreValue (const QString &user, const QString& key, const QVariant &defaultValue = QVariant()); + static void setGuiValue(QString, QVariant) {}; + static QVariant guiValue(QString, QVariant = QVariant()) { return QVariant(); } + protected: + Settings(QString group = "General"); - private: - static QString curProfile; + void setGroup(QString group); + + virtual QStringList allLocalKeys(); + virtual QStringList localChildKeys(); + virtual QStringList localChildGroups(); + //virtual QStringList allSessionKeys() = 0; + virtual QStringList sessionKeys() = 0; + + virtual void setLocalValue(const QString &key, const QVariant &data); + virtual QVariant localValue(const QString &key, const QVariant &def = QVariant()); + + virtual void setSessionValue(const QString &key, const QVariant &data) = 0; + virtual QVariant sessionValue(const QString &key, const QVariant &def = QVariant()) = 0; + + virtual void removeLocalKey(const QString &key); + + QString group; }; -//extern Settings *settings; + #endif