2018-12-13 15:42:28 +00:00
|
|
|
#ifndef APPCONFIG_H
|
|
|
|
#define APPCONFIG_H
|
|
|
|
|
|
|
|
#include <QString>
|
2018-12-18 17:30:26 +00:00
|
|
|
#include <QVariant>
|
|
|
|
#include <QSettings>
|
2018-12-13 15:42:28 +00:00
|
|
|
|
|
|
|
// This class is intended to store app configuration
|
|
|
|
// modifiable from JS side
|
|
|
|
// Currently, only logging-related settings are here
|
|
|
|
// that are used by react-native-desktop-config module
|
|
|
|
class AppConfig {
|
|
|
|
public:
|
|
|
|
|
|
|
|
static AppConfig& inst();
|
|
|
|
|
2018-12-18 17:30:26 +00:00
|
|
|
QVariant getValue(const QString& name) const;
|
|
|
|
void setValue(const QString& name, const QVariant& value);
|
2018-12-13 15:42:28 +00:00
|
|
|
|
2018-12-18 17:30:26 +00:00
|
|
|
const static QString LOGGING_ENABLED;
|
2018-12-13 15:42:28 +00:00
|
|
|
private:
|
|
|
|
AppConfig();
|
|
|
|
|
|
|
|
static AppConfig appConfig;
|
2018-12-18 17:30:26 +00:00
|
|
|
QSettings settings;
|
2018-12-13 15:42:28 +00:00
|
|
|
|
|
|
|
QString getLoggingFilterRules(bool enabled) const;
|
2018-12-18 17:30:26 +00:00
|
|
|
void processFx(const QString& name, const QVariant& value) const;
|
2018-12-13 15:42:28 +00:00
|
|
|
};
|
|
|
|
#endif // APPCONFIG_H
|
2018-12-18 17:30:26 +00:00
|
|
|
|