Diffstat (limited to 'qmake/include/private/qsettings_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qmake/include/private/qsettings_p.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/qmake/include/private/qsettings_p.h b/qmake/include/private/qsettings_p.h index 095291c..4b76f44 100644 --- a/qmake/include/private/qsettings_p.h +++ b/qmake/include/private/qsettings_p.h | |||
@@ -1,133 +1,145 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** |
3 | ** | 3 | ** |
4 | ** Definition of QSettings related classes | 4 | ** Definition of QSettings related classes |
5 | ** | 5 | ** |
6 | ** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. | 6 | ** Created : 990124 |
7 | ** | 7 | ** |
8 | ** This file is part of the tools module of the Qt GUI Toolkit. | 8 | ** Copyright (C) 1999-2002 Trolltech AS. All rights reserved. |
9 | ** | 9 | ** |
10 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | 10 | ** This file is part of the kernel module of the Qt GUI Toolkit. |
11 | ** licenses for Windows may use this file in accordance with the Qt Commercial | 11 | ** |
12 | ** License Agreement provided with the Software. | 12 | ** This file may be distributed under the terms of the Q Public License |
13 | ** as defined by Trolltech AS of Norway and appearing in the file | ||
14 | ** LICENSE.QPL included in the packaging of this file. | ||
15 | ** | ||
16 | ** This file may be distributed and/or modified under the terms of the | ||
17 | ** GNU General Public License version 2 as published by the Free Software | ||
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
19 | ** packaging of this file. | ||
13 | ** | 20 | ** |
14 | ** This file is not available for use under any other license without | 21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition |
15 | ** express written permission from the copyright holder. | 22 | ** licenses may use this file in accordance with the Qt Commercial License |
23 | ** Agreement provided with the Software. | ||
16 | ** | 24 | ** |
17 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
18 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
19 | ** | 27 | ** |
20 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for |
21 | ** information about Qt Commercial License Agreements. | 29 | ** information about Qt Commercial License Agreements. |
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | ||
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
22 | ** | 32 | ** |
23 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
24 | ** not clear to you. | 34 | ** not clear to you. |
25 | ** | 35 | ** |
26 | **********************************************************************/ | 36 | **********************************************************************/ |
27 | 37 | ||
28 | #ifndef QSETTINGS_P_H | 38 | #ifndef QSETTINGS_P_H |
29 | #define QSETTINGS_P_H | 39 | #define QSETTINGS_P_H |
30 | 40 | ||
31 | // | 41 | // |
32 | // W A R N I N G | 42 | // W A R N I N G |
33 | // ------------- | 43 | // ------------- |
34 | // | 44 | // |
35 | // This file is not part of the Qt API. It exists for the convenience | 45 | // This file is not part of the Qt API. It exists for the convenience |
36 | // of QSettings. This header file may change from version to | 46 | // of QSettings. This header file may change from version to |
37 | // version without notice, or even be removed. | 47 | // version without notice, or even be removed. |
38 | // | 48 | // |
39 | // We mean it. | 49 | // We mean it. |
40 | // | 50 | // |
41 | // | 51 | // |
42 | 52 | ||
43 | #ifndef QT_H | 53 | #ifndef QT_H |
44 | #include "qstringlist.h" | 54 | #include "qstringlist.h" |
45 | #include "qmap.h" | 55 | #include "qmap.h" |
46 | #include "qvaluestack.h" | 56 | #include "qvaluestack.h" |
47 | #endif // QT_H | 57 | #endif // QT_H |
48 | 58 | ||
59 | #ifndef QT_NO_SETTINGS | ||
49 | class QSettingsSysPrivate; | 60 | class QSettingsSysPrivate; |
50 | 61 | ||
51 | // QSettingsGroup is a map of key/value pairs | 62 | // QSettingsGroup is a map of key/value pairs |
52 | class QSettingsGroup : public QMap<QString,QString> | 63 | class QSettingsGroup : public QMap<QString,QString> |
53 | { | 64 | { |
54 | public: | 65 | public: |
55 | QSettingsGroup(); | 66 | QSettingsGroup(); |
56 | 67 | ||
57 | bool modified; | 68 | bool modified; |
58 | }; | 69 | }; |
59 | 70 | ||
60 | // QSettingsHeading is a map of heading/group pairs | 71 | // QSettingsHeading is a map of heading/group pairs |
61 | class QSettingsHeading : public QMap<QString,QSettingsGroup> | 72 | class QSettingsHeading : public QMap<QString,QSettingsGroup> |
62 | { | 73 | { |
63 | public: | 74 | public: |
64 | QSettingsHeading::Iterator git; | 75 | QSettingsHeading::Iterator git; |
65 | void read(const QString &); | 76 | void read(const QString &); |
66 | void parseLine(QTextStream &); | 77 | void parseLine(QTextStream &); |
67 | }; | 78 | }; |
68 | 79 | ||
69 | 80 | ||
70 | class QSettingsPrivate | 81 | class QSettingsPrivate |
71 | { | 82 | { |
72 | public: | 83 | public: |
73 | QSettingsPrivate( QSettings::Format format ); | 84 | QSettingsPrivate( QSettings::Format format ); |
74 | ~QSettingsPrivate(); | 85 | ~QSettingsPrivate(); |
75 | 86 | ||
76 | QSettingsGroup readGroup(); | 87 | QSettingsGroup readGroup(); |
77 | void removeGroup(const QString &); | 88 | void removeGroup(const QString &); |
78 | void writeGroup(const QString &, const QString &); | 89 | void writeGroup(const QString &, const QString &); |
79 | QDateTime modificationTime(); | 90 | QDateTime modificationTime(); |
80 | 91 | ||
81 | QStringList searchPaths; | 92 | QStringList searchPaths; |
82 | QMap<QString,QSettingsHeading> headings; | 93 | QMap<QString,QSettingsHeading> headings; |
83 | QString group; | 94 | QString group; |
84 | QString heading; | 95 | QString heading; |
85 | 96 | ||
86 | /*### static data brings threading trouble | 97 | /*### static data brings threading trouble |
87 | static QString *defProduct; | 98 | static QString *defProduct; |
88 | static QString *defDomain; | 99 | static QString *defDomain; |
89 | */ | 100 | */ |
90 | QValueStack<QString> groupStack; | 101 | QValueStack<QString> groupStack; |
91 | QString groupPrefix; | 102 | QString groupPrefix; |
92 | 103 | ||
93 | bool groupDirty :1; | 104 | bool groupDirty :1; |
94 | bool modified :1; | 105 | bool modified :1; |
95 | bool globalScope :1; | 106 | bool globalScope :1; |
96 | 107 | ||
97 | #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_OS_MAC)) | 108 | #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_OS_MAC)) |
98 | // system dependent implementations to use the | 109 | // system dependent implementations to use the |
99 | // system specific setting database (ie. registry on Windows) | 110 | // system specific setting database (ie. registry on Windows) |
100 | 111 | ||
101 | QSettingsSysPrivate *sysd; | 112 | QSettingsSysPrivate *sysd; |
102 | voidsysInit(); | 113 | voidsysInit(); |
103 | voidsysClear(); | 114 | voidsysClear(); |
104 | 115 | ||
105 | #if !defined(Q_NO_BOOL_TYPE) | 116 | #if !defined(Q_NO_BOOL_TYPE) |
106 | boolsysWriteEntry( const QString &, bool ); | 117 | boolsysWriteEntry( const QString &, bool ); |
107 | #endif | 118 | #endif |
108 | boolsysWriteEntry( const QString &, double ); | 119 | boolsysWriteEntry( const QString &, double ); |
109 | boolsysWriteEntry( const QString &, int ); | 120 | boolsysWriteEntry( const QString &, int ); |
110 | boolsysWriteEntry( const QString &, const QString & ); | 121 | boolsysWriteEntry( const QString &, const QString & ); |
111 | boolsysWriteEntry( const QString &, const QStringList & ); | 122 | boolsysWriteEntry( const QString &, const QStringList & ); |
112 | boolsysWriteEntry( const QString &, const QStringList &, const QChar& sep ); | 123 | boolsysWriteEntry( const QString &, const QStringList &, const QChar& sep ); |
113 | 124 | ||
114 | QStringList sysEntryList(const QString &) const; | 125 | QStringList sysEntryList(const QString &) const; |
115 | QStringList sysSubkeyList(const QString &) const; | 126 | QStringList sysSubkeyList(const QString &) const; |
116 | 127 | ||
117 | QStringList sysReadListEntry( const QString &, bool * = 0 ) const; | 128 | QStringList sysReadListEntry( const QString &, bool * = 0 ) const; |
118 | QStringList sysReadListEntry( const QString &, const QChar& sep, bool * = 0 ) const; | 129 | QStringList sysReadListEntry( const QString &, const QChar& sep, bool * = 0 ) const; |
119 | QStringsysReadEntry( const QString &, const QString &def = QString::null, bool * = 0 ) const; | 130 | QStringsysReadEntry( const QString &, const QString &def = QString::null, bool * = 0 ) const; |
120 | int sysReadNumEntry( const QString &, int def = 0, bool * = 0 ) const; | 131 | int sysReadNumEntry( const QString &, int def = 0, bool * = 0 ) const; |
121 | doublesysReadDoubleEntry( const QString &, double def = 0, bool * = 0 ) const; | 132 | doublesysReadDoubleEntry( const QString &, double def = 0, bool * = 0 ) const; |
122 | boolsysReadBoolEntry( const QString &, bool def = 0, bool * = 0 ) const; | 133 | boolsysReadBoolEntry( const QString &, bool def = 0, bool * = 0 ) const; |
123 | 134 | ||
124 | boolsysRemoveEntry( const QString & ); | 135 | boolsysRemoveEntry( const QString & ); |
125 | 136 | ||
126 | boolsysSync(); | 137 | boolsysSync(); |
127 | 138 | ||
128 | voidsysInsertSearchPath( QSettings::System, const QString & ); | 139 | voidsysInsertSearchPath( QSettings::System, const QString & ); |
129 | voidsysRemoveSearchPath( QSettings::System, const QString & ); | 140 | voidsysRemoveSearchPath( QSettings::System, const QString & ); |
130 | #endif | 141 | #endif |
131 | }; | ||
132 | 142 | ||
143 | }; | ||
144 | #endif //QT_NO_SETTINGS | ||
133 | #endif // QSETTINGS_P_H | 145 | #endif // QSETTINGS_P_H |