author | insilmaril |
Tue Jan 24 15:09:48 2006 +0000 (2006-01-24) | |
changeset 180 | 60e2297bab39 |
parent 0 | 7a96bd401351 |
child 188 | 90969608255c |
permissions | -rw-r--r-- |
insilmaril@0 | 1 |
#ifndef SETTINGS_H |
insilmaril@0 | 2 |
#define SETTINGS_H |
insilmaril@0 | 3 |
|
insilmaril@0 | 4 |
#include <qsettings.h> |
insilmaril@0 | 5 |
#include <qstring.h> |
insilmaril@0 | 6 |
#include <qstringlist.h> |
insilmaril@0 | 7 |
|
insilmaril@0 | 8 |
#include "misc.h" |
insilmaril@0 | 9 |
|
insilmaril@163 | 10 |
// Some helper functions and simplified settings class |
insilmaril@163 | 11 |
// to read and parse settings e.g. in undo/redo directories |
insilmaril@163 | 12 |
bool loadStringFromDisk (const QString &, QString &); |
insilmaril@163 | 13 |
bool saveStringToDisk (const QString &, const QString &s); |
insilmaril@0 | 14 |
|
insilmaril@163 | 15 |
class SimpleSettings |
insilmaril@163 | 16 |
{ |
insilmaril@163 | 17 |
public: |
insilmaril@163 | 18 |
SimpleSettings (); |
insilmaril@163 | 19 |
~SimpleSettings (); |
insilmaril@163 | 20 |
void clear(); |
insilmaril@163 | 21 |
void readSettings(const QString &); |
insilmaril@163 | 22 |
void writeSettings(const QString &); |
insilmaril@163 | 23 |
QString readEntry (const QString &); |
insilmaril@163 | 24 |
void setEntry (const QString &,const QString &); |
insilmaril@163 | 25 |
private: |
insilmaril@163 | 26 |
QStringList keylist; |
insilmaril@163 | 27 |
QStringList valuelist; |
insilmaril@163 | 28 |
}; |
insilmaril@163 | 29 |
|
insilmaril@163 | 30 |
|
insilmaril@163 | 31 |
// Overloaded QSettings class, used to save some settings in |
insilmaril@163 | 32 |
// a map instead of users home directory |
insilmaril@0 | 33 |
class Settings:public QSettings,public xmlObj |
insilmaril@0 | 34 |
{ |
insilmaril@0 | 35 |
public: |
insilmaril@0 | 36 |
Settings (); |
insilmaril@0 | 37 |
~Settings (); |
insilmaril@0 | 38 |
void clear(); |
insilmaril@0 | 39 |
void clearLocal (const QString &); |
insilmaril@0 | 40 |
QString readLocalEntry ( const QString &, const QString &, const QString &); |
insilmaril@0 | 41 |
void setLocalEntry (const QString &, const QString &, const QString &); |
insilmaril@0 | 42 |
QString getXMLData (const QString &); |
insilmaril@0 | 43 |
|
insilmaril@0 | 44 |
protected: |
insilmaril@0 | 45 |
QStringList pathlist; |
insilmaril@0 | 46 |
QStringList keylist; |
insilmaril@0 | 47 |
QStringList valuelist; |
insilmaril@0 | 48 |
}; |
insilmaril@0 | 49 |
|
insilmaril@0 | 50 |
#endif |