settings.h
author insilmaril
Thu, 23 Mar 2006 12:38:54 +0000
changeset 257 199f2626fe70
parent 188 90969608255c
child 366 e95081c21da2
permissions -rw-r--r--
Version 1.7.12
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@0
    12
insilmaril@163
    13
class SimpleSettings
insilmaril@163
    14
{
insilmaril@163
    15
public:
insilmaril@163
    16
    SimpleSettings ();
insilmaril@163
    17
	~SimpleSettings ();
insilmaril@163
    18
	void clear();
insilmaril@163
    19
	void readSettings(const QString &);
insilmaril@163
    20
	void writeSettings(const QString &);
insilmaril@163
    21
	QString readEntry (const QString &);
insilmaril@163
    22
	void setEntry (const QString &,const QString &);
insilmaril@163
    23
private:	
insilmaril@163
    24
	QStringList keylist;
insilmaril@163
    25
	QStringList valuelist;
insilmaril@163
    26
};
insilmaril@163
    27
insilmaril@163
    28
insilmaril@163
    29
// Overloaded QSettings class, used to save some settings in 
insilmaril@163
    30
// a map instead of users home directory
insilmaril@0
    31
class Settings:public QSettings,public xmlObj
insilmaril@0
    32
{
insilmaril@0
    33
public:
insilmaril@0
    34
    Settings ();
insilmaril@0
    35
	~Settings ();
insilmaril@0
    36
	void clear();
insilmaril@0
    37
	void clearLocal (const QString &);
insilmaril@0
    38
	QString readLocalEntry ( const QString &, const QString &, const QString &);
insilmaril@0
    39
	void setLocalEntry (const QString &, const QString &, const QString &);
insilmaril@0
    40
	QString getXMLData (const QString &);
insilmaril@0
    41
insilmaril@0
    42
protected:
insilmaril@0
    43
	QStringList pathlist;
insilmaril@0
    44
	QStringList keylist;
insilmaril@0
    45
	QStringList valuelist;
insilmaril@0
    46
};
insilmaril@0
    47
insilmaril@0
    48
#endif