summaryrefslogtreecommitdiff
path: root/library/config.h
Unidiff
Diffstat (limited to 'library/config.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/config.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/config.h b/library/config.h
index 1dc32fa..0bab7ca 100644
--- a/library/config.h
+++ b/library/config.h
@@ -26,25 +26,25 @@
26#include <qmap.h> 26#include <qmap.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28 28
29class ConfigPrivate; 29class ConfigPrivate;
30class Config 30class Config
31{ 31{
32public: 32public:
33 typedef QMap< QString, QString > ConfigGroup; 33 typedef QMap< QString, QString > ConfigGroup;
34 34
35 enum Domain { File, User }; 35 enum Domain { File, User };
36 Config( const QString &name, Domain domain=User ); 36 Config( const QString &name, Domain domain=User );
37 ~Config(); 37 ~Config();
38 38
39 bool operator == ( const Config & other ) const { return (filename == other.filename); } 39 bool operator == ( const Config & other ) const { return (filename == other.filename); }
40 bool operator != ( const Config & other ) const { return (filename != other.filename); } 40 bool operator != ( const Config & other ) const { return (filename != other.filename); }
41 41
42 bool isValid() const; 42 bool isValid() const;
43 bool hasKey( const QString &key ) const; 43 bool hasKey( const QString &key ) const;
44 44
45 void setGroup( const QString &gname ); 45 void setGroup( const QString &gname );
46 void writeEntry( const QString &key, const char* value ); 46 void writeEntry( const QString &key, const char* value );
47 void writeEntry( const QString &key, const QString &value ); 47 void writeEntry( const QString &key, const QString &value );
48 void writeEntryCrypt( const QString &key, const QString &value ); 48 void writeEntryCrypt( const QString &key, const QString &value );
49 void writeEntry( const QString &key, int num ); 49 void writeEntry( const QString &key, int num );
50#ifdef Q_HAS_BOOL_TYPE 50#ifdef Q_HAS_BOOL_TYPE
@@ -75,24 +75,27 @@ public:
75protected: 75protected:
76 void read(); 76 void read();
77 bool parse( const QString &line ); 77 bool parse( const QString &line );
78 78
79 QMap< QString, ConfigGroup > groups; 79 QMap< QString, ConfigGroup > groups;
80 QMap< QString, ConfigGroup >::Iterator git; 80 QMap< QString, ConfigGroup >::Iterator git;
81 QString filename; 81 QString filename;
82 QString lang; 82 QString lang;
83 QString glang; 83 QString glang;
84 bool changed; 84 bool changed;
85 ConfigPrivate *d; 85 ConfigPrivate *d;
86 static QString configFilename(const QString& name, Domain); 86 static QString configFilename(const QString& name, Domain);
87
88private: // Sharp ROM compatibility
89 Config( const QString &name, bool what );
87}; 90};
88 91
89inline QString Config::readEntry( const QString &key, const QString &deflt ) const 92inline QString Config::readEntry( const QString &key, const QString &deflt ) const
90{ return ((Config*)this)->readEntry(key,deflt); } 93{ return ((Config*)this)->readEntry(key,deflt); }
91inline QString Config::readEntryCrypt( const QString &key, const QString &deflt ) const 94inline QString Config::readEntryCrypt( const QString &key, const QString &deflt ) const
92{ return ((Config*)this)->readEntryCrypt(key,deflt); } 95{ return ((Config*)this)->readEntryCrypt(key,deflt); }
93inline QString Config::readEntryDirect( const QString &key, const QString &deflt ) const 96inline QString Config::readEntryDirect( const QString &key, const QString &deflt ) const
94{ return ((Config*)this)->readEntryDirect(key,deflt); } 97{ return ((Config*)this)->readEntryDirect(key,deflt); }
95inline int Config::readNumEntry( const QString &key, int deflt ) const 98inline int Config::readNumEntry( const QString &key, int deflt ) const
96{ return ((Config*)this)->readNumEntry(key,deflt); } 99{ return ((Config*)this)->readNumEntry(key,deflt); }
97inline bool Config::readBoolEntry( const QString &key, bool deflt ) const 100inline bool Config::readBoolEntry( const QString &key, bool deflt ) const
98{ return ((Config*)this)->readBoolEntry(key,deflt); } 101{ return ((Config*)this)->readBoolEntry(key,deflt); }