mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Cleanup: don't instantiate a QPref object
QPref has only static functions. There seems to be no point in instantiating a singleton of this object. Remove the instance() method and remove the Q_OBJECT macro. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e9fa298d06
commit
a89b36c661
2 changed files with 1 additions and 17 deletions
|
@ -18,16 +18,6 @@
|
|||
#include <QtQml>
|
||||
#include <QQmlContext>
|
||||
|
||||
qPref::qPref(QObject *parent) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
qPref *qPref::instance()
|
||||
{
|
||||
static qPref *self = new qPref;
|
||||
return self;
|
||||
}
|
||||
|
||||
void qPref::loadSync(bool doSync)
|
||||
{
|
||||
if (!doSync)
|
||||
|
@ -58,7 +48,6 @@ void qPref::registerQML(QQmlEngine *engine)
|
|||
if (engine) {
|
||||
QQmlContext *ct = engine->rootContext();
|
||||
|
||||
ct->setContextProperty("Pref", qPref::instance());
|
||||
ct->setContextProperty("PrefCloudStorage", qPrefCloudStorage::instance());
|
||||
ct->setContextProperty("PrefDisplay", qPrefDisplay::instance());
|
||||
ct->setContextProperty("PrefDiveComputer", qPrefDiveComputer::instance());
|
||||
|
|
|
@ -6,13 +6,8 @@
|
|||
#include <QObject>
|
||||
#include <QQmlEngine>
|
||||
|
||||
class qPref : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
class qPref {
|
||||
public:
|
||||
qPref(QObject *parent = NULL);
|
||||
static qPref *instance();
|
||||
|
||||
// Load/Sync local settings (disk) and struct preference
|
||||
static void load() { loadSync(false); }
|
||||
static void sync() { loadSync(true); }
|
||||
|
|
Loading…
Reference in a new issue