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