2012-02-29 18:33:50 +01:00
|
|
|
/* ============================================================
|
2017-08-25 17:11:29 +02:00
|
|
|
* Falkon - Qt web browser
|
2018-01-02 18:05:19 +01:00
|
|
|
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
|
2012-02-29 18:33:50 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2012-01-11 21:58:25 +01:00
|
|
|
#ifndef SETTINGS_H
|
|
|
|
#define SETTINGS_H
|
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
#include <QVariant>
|
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2012-02-29 18:33:50 +01:00
|
|
|
|
|
|
|
class QSettings;
|
2012-01-11 21:58:25 +01:00
|
|
|
|
2012-08-10 21:16:43 +02:00
|
|
|
class QzSettings;
|
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
class FALKON_EXPORT Settings
|
2012-01-11 21:58:25 +01:00
|
|
|
{
|
|
|
|
public:
|
2012-01-21 20:27:45 +01:00
|
|
|
explicit Settings();
|
2012-01-11 21:58:25 +01:00
|
|
|
~Settings();
|
|
|
|
|
|
|
|
static void createSettings(const QString &fileName);
|
|
|
|
static void syncSettings();
|
|
|
|
|
2012-02-13 19:09:02 +01:00
|
|
|
static QSettings* globalSettings();
|
2012-08-10 21:16:43 +02:00
|
|
|
static QzSettings* staticSettings();
|
2012-02-13 19:09:02 +01:00
|
|
|
|
2018-01-02 18:05:19 +01:00
|
|
|
bool contains(const QString &key) const;
|
2018-01-05 19:51:58 +01:00
|
|
|
void remove(const QString &key);
|
2018-01-02 18:05:19 +01:00
|
|
|
|
2012-01-11 21:58:25 +01:00
|
|
|
void setValue(const QString &key, const QVariant &defaultValue = QVariant());
|
|
|
|
QVariant value(const QString &key, const QVariant &defaultValue = QVariant());
|
|
|
|
|
|
|
|
void beginGroup(const QString &prefix);
|
|
|
|
void endGroup();
|
|
|
|
|
|
|
|
private:
|
2012-04-17 18:26:01 +02:00
|
|
|
static QSettings* s_settings;
|
2012-08-10 21:16:43 +02:00
|
|
|
static QzSettings* s_qzSettings;
|
2012-01-11 21:58:25 +01:00
|
|
|
|
2014-11-01 17:50:26 +01:00
|
|
|
QString m_openedGroup;
|
|
|
|
|
2012-01-11 21:58:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SETTINGS_H
|