diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/common/global/generic_config.h | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/common/global/generic_config.h')
-rw-r--r-- | src/common/global/generic_config.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/common/global/generic_config.h b/src/common/global/generic_config.h index 70dfeaa..74002e5 100644 --- a/src/common/global/generic_config.h +++ b/src/common/global/generic_config.h @@ -9,8 +9,8 @@ #ifndef GENERIC_CONFIG_H #define GENERIC_CONFIG_H -#include <qvariant.h> -#include <qsize.h> +#include <tqvariant.h> +#include <tqsize.h> #include "global.h" #include "common/common/misc.h" @@ -20,50 +20,50 @@ class GenericConfigPrivate; class GenericConfig { public: - GenericConfig(const QString &group); + GenericConfig(const TQString &group); ~GenericConfig(); - QString group() const { return _group; } + TQString group() const { return _group; } void rollback(); - QString readEntry(const QString &key, const QString &def = QString::null) const; - void writeEntry(const QString &key, const QString &value); - void writeEntry(const QString &key, const QCString &value) { writeEntry(key, QString(value)); } - void writeEntry(const QString &key, const char *value) { writeEntry(key, QString(value)); } - QStringList readListEntry(const QString &key, const QStringList &defaultValues) const; - void writeEntry(const QString &key, const QStringList &value); - QValueList<int> readIntListEntry(const QString &key) const; - void writeEntry(const QString &key, const QValueList<int> &value); - QSize readSizeEntry(const QString &key, const QSize *def = 0) const; - void writeEntry(const QString &key, const QSize &value); - bool readBoolEntry(const QString &key, bool def) const; - void writeEntry(const QString &key, bool value); - int readIntEntry(const QString &key, int def = 0) const; - void writeEntry(const QString &key, int value); - uint readUIntEntry(const QString &key, uint def = 0) const { return qMax(0, readIntEntry(key, def)); } - void writeEntry(const QString &key, uint value) { writeEntry(key, int(value)); } + TQString readEntry(const TQString &key, const TQString &def = TQString()) const; + void writeEntry(const TQString &key, const TQString &value); + void writeEntry(const TQString &key, const TQCString &value) { writeEntry(key, TQString(value)); } + void writeEntry(const TQString &key, const char *value) { writeEntry(key, TQString(value)); } + TQStringList readListEntry(const TQString &key, const TQStringList &defaultValues) const; + void writeEntry(const TQString &key, const TQStringList &value); + TQValueList<int> readIntListEntry(const TQString &key) const; + void writeEntry(const TQString &key, const TQValueList<int> &value); + TQSize readSizeEntry(const TQString &key, const TQSize *def = 0) const; + void writeEntry(const TQString &key, const TQSize &value); + bool readBoolEntry(const TQString &key, bool def) const; + void writeEntry(const TQString &key, bool value); + int readIntEntry(const TQString &key, int def = 0) const; + void writeEntry(const TQString &key, int value); + uint readUIntEntry(const TQString &key, uint def = 0) const { return qMax(0, readIntEntry(key, def)); } + void writeEntry(const TQString &key, uint value) { writeEntry(key, int(value)); } template <typename Enum> - Enum readEnumEntry(const QString &key, Enum def = Enum::Nb_Types) const { return Enum::fromKey(readEntry(key, def.key())); } + Enum readEnumEntry(const TQString &key, Enum def = Enum::Nb_Types) const { return Enum::fromKey(readEntry(key, def.key())); } template <typename Enum> - void writeEnumEntry(const QString &key, Enum v) { writeEntry(key, v.key()); } - QVariant readVariantEntry(const QString &key, const QVariant &defValue) const; - void writeEntry(const QString &key, const QVariant &value); + void writeEnumEntry(const TQString &key, Enum v) { writeEntry(key, v.key()); } + TQVariant readVariantEntry(const TQString &key, const TQVariant &defValue) const; + void writeEntry(const TQString &key, const TQVariant &value); - static void deleteGroup(const QString &group); + static void deleteGroup(const TQString &group); struct ItemData { const char *key, *label; - QVariant defValue; + TQVariant defValue; }; template <typename Type> - QVariant readVariantEntry(Type type) const { return readVariantEntry(type.data().key, type.data().defValue); } + TQVariant readVariantEntry(Type type) const { return readVariantEntry(type.data().key, type.data().defValue); } template <typename Type> - void writeVariantEntry(Type type, const QVariant &value) { + void writeVariantEntry(Type type, const TQVariant &value) { Q_ASSERT( value.type()==type.data().defValue.type() ); writeEntry(type.data().key, value); } private: - QString _group; + TQString _group; GenericConfigPrivate *_d; }; @@ -72,11 +72,11 @@ private: #define END_DECLARE_CONFIG(Type, group) \ END_DECLARE_ENUM(Type, GenericConfig::ItemData) \ - inline QVariant readConfigEntry(Type type) { \ + inline TQVariant readConfigEntry(Type type) { \ GenericConfig config(group); \ return config.readVariantEntry<Type>(type); \ } \ - inline void writeConfigEntry(Type type, const QVariant &v) { \ + inline void writeConfigEntry(Type type, const TQVariant &v) { \ GenericConfig config(group); \ config.writeVariantEntry<Type>(type, v); \ } |