2
* \file generalconfig.h
3
* General configuration.
9
* Copyright (C) 2003-2007 Urs Fleisch
11
* This file is part of Kid3.
13
* Kid3 is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
18
* Kid3 is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#ifndef GENERALCONFIG_H
28
#define GENERALCONFIG_H
36
#if QT_VERSION >= 0x030100
37
#include <qsettings.h>
38
typedef QSettings Kid3Settings;
41
#include <qstringlist.h>
43
/** Quick and dirty replacement for QSettings */
46
enum Scope { User, Global };
49
void setPath(const QString&, const QString&, Scope = Global);
50
void beginGroup(const QString& grp);
52
void writeEntry(const QString& key, int val);
53
void writeEntry(const QString& key, bool val);
54
void writeEntry(const QString& key, const QString& val);
55
void writeEntry(const QString& key, const QStringList& val);
56
void writeEntry(const QString& key, const QMap<QString, QString>& val);
57
QString readEntry(const QString& key, const QString& dflt = QString::null);
58
int readNumEntry(const QString& key, int dflt = 0);
59
bool readBoolEntry(const QString& key, bool dflt = 0);
60
QStringList readListEntry(const QString& key);
61
QMap<QString, QString> readMapEntry(const QString& key, const QMap<QString, QString>& dflt);
62
bool removeEntry(const QString& key);
64
QMap<QString, QString> m_map;
71
* Abstract base class for configurations.
77
* Set default configuration.
79
* @param grp configuration group
81
GeneralConfig(const QString& grp);
86
virtual ~GeneralConfig();
89
* Persist configuration.
91
* @param config KDE configuration
93
virtual void writeToConfig(
102
* Read persisted configuration.
104
* @param config KDE configuration
106
virtual void readFromConfig(
107
#ifdef CONFIG_USE_KDE
115
/** Configuration group. */