status-react/desktop/appconfig.h
Vitaliy Vlasov e40e495e11
Use QSettings in AppConfig
Some more changes

Changes

Fix review items

Rename init-settings to restore-native-settings

Restore application name (thanks @churik !)

Remove org name/domain setting for desktop

Change organization name to include domain

Re-use default values in :desktop/desktop

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
2018-12-19 19:53:54 +02:00

32 lines
721 B
C++

#ifndef APPCONFIG_H
#define APPCONFIG_H
#include <QString>
#include <QVariant>
#include <QSettings>
// 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();
QVariant getValue(const QString& name) const;
void setValue(const QString& name, const QVariant& value);
const static QString LOGGING_ENABLED;
private:
AppConfig();
static AppConfig appConfig;
QSettings settings;
QString getLoggingFilterRules(bool enabled) const;
void processFx(const QString& name, const QVariant& value) const;
};
#endif // APPCONFIG_H