2017-07-03 09:30:10 +02:00
|
|
|
/*!
|
2017-12-20 14:54:05 +01:00
|
|
|
* \copyright Copyright (c) 2014-2017 Governikus GmbH & Co. KG, Germany
|
2017-07-03 09:30:10 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QSharedPointer>
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
#ifndef QT_NO_DEBUG
|
|
|
|
#include <QTemporaryDir>
|
|
|
|
#endif
|
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
#define SETTINGS_NAME(_name, _key)\
|
|
|
|
QString _name(){\
|
|
|
|
return QStringLiteral(_key);\
|
|
|
|
}
|
|
|
|
|
2017-07-03 09:30:10 +02:00
|
|
|
namespace governikus
|
|
|
|
{
|
|
|
|
|
|
|
|
class AbstractSettings
|
|
|
|
: public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
private:
|
|
|
|
static void createLegacyFileMapping();
|
|
|
|
|
2017-07-03 09:30:10 +02:00
|
|
|
protected:
|
|
|
|
AbstractSettings();
|
|
|
|
virtual ~AbstractSettings();
|
|
|
|
|
|
|
|
public:
|
|
|
|
#ifndef QT_NO_DEBUG
|
|
|
|
static QSharedPointer<QTemporaryDir> mTestDir;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static QSharedPointer<QSettings> getStore();
|
|
|
|
|
|
|
|
virtual void save() = 0;
|
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
bool appIsBackgroundService() const;
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void fireSettingsChanged();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} /* namespace governikus */
|