-rw-r--r-- | microkde/kconfig.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/microkde/kconfig.h b/microkde/kconfig.h index bfedf53..a01b1a5 100644 --- a/microkde/kconfig.h +++ b/microkde/kconfig.h | |||
@@ -1,100 +1,104 @@ | |||
1 | #ifndef MINIKDE_KCONFIG_H | 1 | #ifndef MINIKDE_KCONFIG_H |
2 | #define MINIKDE_KCONFIG_H | 2 | #define MINIKDE_KCONFIG_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qvaluelist.h> | 6 | #include <qvaluelist.h> |
7 | #include <qcolor.h> | 7 | #include <qcolor.h> |
8 | #include <qfont.h> | 8 | #include <qfont.h> |
9 | #include <qmap.h> | 9 | #include <qmap.h> |
10 | #include <qdatetime.h> | 10 | #include <qdatetime.h> |
11 | 11 | ||
12 | class KConfig | 12 | class KConfig |
13 | { | 13 | { |
14 | public: | 14 | public: |
15 | KConfig( const QString & ); | 15 | KConfig( const QString & ); |
16 | ~KConfig(); | 16 | ~KConfig(); |
17 | 17 | ||
18 | void setTempGroup( const QString &group ); | ||
19 | QString tempGroup() const; | ||
20 | |||
18 | void setGroup( const QString & ); | 21 | void setGroup( const QString & ); |
19 | 22 | ||
20 | //US | 23 | //US |
21 | /** | 24 | /** |
22 | * Returns the name of the group in which we are | 25 | * Returns the name of the group in which we are |
23 | * searching for keys and from which we are retrieving entries. | 26 | * searching for keys and from which we are retrieving entries. |
24 | * | 27 | * |
25 | * @return The current group. | 28 | * @return The current group. |
26 | */ | 29 | */ |
27 | QString group() const; | 30 | QString group() const; |
28 | 31 | ||
29 | //US I took the following deleteGroup method from a newer version from KDE. | 32 | //US I took the following deleteGroup method from a newer version from KDE. |
30 | /** | 33 | /** |
31 | * Deletes a configuration entry group | 34 | * Deletes a configuration entry group |
32 | * | 35 | * |
33 | * If the group is not empty and bDeep is false, nothing gets | 36 | * If the group is not empty and bDeep is false, nothing gets |
34 | * deleted and false is returned. | 37 | * deleted and false is returned. |
35 | * If this group is the current group and it is deleted, the | 38 | * If this group is the current group and it is deleted, the |
36 | * current group is undefined and should be set with setGroup() | 39 | * current group is undefined and should be set with setGroup() |
37 | * before the next operation on the configuration object. | 40 | * before the next operation on the configuration object. |
38 | * | 41 | * |
39 | * @param group The name of the group | 42 | * @param group The name of the group |
40 | * returns true if we deleted at least one entry. | 43 | * returns true if we deleted at least one entry. |
41 | */ | 44 | */ |
42 | bool deleteGroup( const QString& group); | 45 | bool deleteGroup( const QString& group); |
43 | 46 | ||
44 | //US I took the following hasGroup method from a newer version from KDE. | 47 | //US I took the following hasGroup method from a newer version from KDE. |
45 | /** | 48 | /** |
46 | * Returns true if the specified group is known about. | 49 | * Returns true if the specified group is known about. |
47 | * | 50 | * |
48 | * @param group The group to search for. | 51 | * @param group The group to search for. |
49 | * @return Whether the group exists. | 52 | * @return Whether the group exists. |
50 | */ | 53 | */ |
51 | bool hasGroup(const QString &group) const; | 54 | bool hasGroup(const QString &group) const; |
52 | 55 | ||
53 | 56 | ||
54 | QString getFileName(); | 57 | QString getFileName(); |
55 | 58 | ||
56 | //US added method readIntListEntry | 59 | //US added method readIntListEntry |
57 | QValueList<int> readIntListEntry( const QString &); | 60 | QValueList<int> readIntListEntry( const QString &); |
58 | 61 | ||
59 | int readNumEntry( const QString &, int def=0 ); | 62 | int readNumEntry( const QString &, int def=0 ); |
60 | QString readEntry( const QString &, const QString &def=QString::null ); | 63 | QString readEntry( const QString &, const QString &def=QString::null ); |
61 | QStringList readListEntry( const QString & ); | 64 | QStringList readListEntry( const QString & ); |
62 | bool readBoolEntry( const QString &, bool def=false ); | 65 | bool readBoolEntry( const QString &, bool def=false ); |
63 | QColor readColorEntry( const QString &, QColor * ); | 66 | QColor readColorEntry( const QString &, QColor * ); |
64 | QFont readFontEntry( const QString &, QFont * ); | 67 | QFont readFontEntry( const QString &, QFont * ); |
65 | QDateTime readDateTimeEntry( const QString &, const QDateTime *pDefault = 0 ); | 68 | QDateTime readDateTimeEntry( const QString &, const QDateTime *pDefault = 0 ); |
66 | 69 | ||
67 | bool hasKey( const QString &); | 70 | bool hasKey( const QString &); |
68 | 71 | ||
69 | void writeEntry( const QString &, const QValueList<int>& ); | 72 | void writeEntry( const QString &, const QValueList<int>& ); |
70 | void writeEntry( const QString &, int ); | 73 | void writeEntry( const QString &, int ); |
71 | void writeEntry( const QString &key , unsigned int value) { writeEntry( key, int( value ) ); } | 74 | void writeEntry( const QString &key , unsigned int value) { writeEntry( key, int( value ) ); } |
72 | void writeEntry( const char *key , unsigned int value) { writeEntry( QString( key ), value ); } | 75 | void writeEntry( const char *key , unsigned int value) { writeEntry( QString( key ), value ); } |
73 | void writeEntry( const char *key, int value ) { writeEntry( QString( key ), value ); } | 76 | void writeEntry( const char *key, int value ) { writeEntry( QString( key ), value ); } |
74 | void writeEntry( const QString &, const QString & ); | 77 | void writeEntry( const QString &, const QString & ); |
75 | void writeEntry( const char *key, const QString &value ) { writeEntry( QString( key ), value ); } | 78 | void writeEntry( const char *key, const QString &value ) { writeEntry( QString( key ), value ); } |
76 | void writeEntry( const QString &, const QStringList & ); | 79 | void writeEntry( const QString &, const QStringList & ); |
77 | void writeEntry( const QString &, bool ); | 80 | void writeEntry( const QString &, bool ); |
78 | void writeEntry( const char *key, bool value ) { writeEntry( QString( key ), value ); } | 81 | void writeEntry( const char *key, bool value ) { writeEntry( QString( key ), value ); } |
79 | void writeEntry( const QString &, const QColor & ); | 82 | void writeEntry( const QString &, const QColor & ); |
80 | void writeEntry( const QString &, const QFont & ); | 83 | void writeEntry( const QString &, const QFont & ); |
81 | void writeEntry( const QString &, const QDateTime & ); | 84 | void writeEntry( const QString &, const QDateTime & ); |
82 | 85 | ||
83 | void deleteEntry( const QString &); | 86 | void deleteEntry( const QString &); |
84 | 87 | ||
85 | void load(); | 88 | void load(); |
86 | void sync(); | 89 | void sync(); |
87 | 90 | ||
88 | private: | 91 | private: |
89 | static QString mGroup; | 92 | static QString mGroup; |
93 | QString mTempGroup; | ||
90 | 94 | ||
91 | QString mFileName; | 95 | QString mFileName; |
92 | 96 | ||
93 | QMap<QString,bool> mBoolMap; | 97 | QMap<QString,bool> mBoolMap; |
94 | QMap<QString,QString> mStringMap; | 98 | QMap<QString,QString> mStringMap; |
95 | QMap<QString,QDateTime> mDateTimeMap; | 99 | QMap<QString,QDateTime> mDateTimeMap; |
96 | 100 | ||
97 | bool mDirty; | 101 | bool mDirty; |
98 | }; | 102 | }; |
99 | 103 | ||
100 | #endif | 104 | #endif |