2018-06-16 16:03:31 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef QPREF_H
|
|
|
|
#define QPREF_H
|
|
|
|
#include "core/pref.h"
|
2018-08-14 09:56:20 +02:00
|
|
|
|
2018-07-25 10:49:48 -07:00
|
|
|
#include <QObject>
|
2018-09-04 11:18:43 +02:00
|
|
|
#include <QQmlEngine>
|
2018-06-16 16:03:31 +02:00
|
|
|
|
|
|
|
class qPref : public QObject {
|
|
|
|
Q_OBJECT
|
2018-07-07 22:59:26 +02:00
|
|
|
Q_PROPERTY(QString canonical_version READ canonical_version);
|
|
|
|
Q_PROPERTY(QString mobile_version READ mobile_version);
|
2018-06-16 16:03:31 +02:00
|
|
|
|
|
|
|
public:
|
2018-06-16 10:08:34 +02:00
|
|
|
qPref(QObject *parent = NULL);
|
2018-06-16 16:03:31 +02:00
|
|
|
static qPref *instance();
|
|
|
|
|
|
|
|
// Load/Sync local settings (disk) and struct preference
|
2018-08-14 09:56:20 +02:00
|
|
|
static void load() { loadSync(false); }
|
|
|
|
static void sync() { loadSync(true); }
|
2018-06-16 16:03:31 +02:00
|
|
|
|
2018-08-31 11:57:28 +02:00
|
|
|
// Register QML
|
2018-09-04 11:18:43 +02:00
|
|
|
void registerQML(QQmlEngine *engine);
|
2018-08-31 11:57:28 +02:00
|
|
|
|
2018-06-16 16:03:31 +02:00
|
|
|
public:
|
2018-10-24 22:28:26 +01:00
|
|
|
static const QString canonical_version();
|
|
|
|
static const QString mobile_version();
|
2018-08-14 09:56:20 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void loadSync(bool doSync);
|
2018-06-16 16:03:31 +02:00
|
|
|
};
|
|
|
|
#endif
|