aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-03 23:28:26 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-04 09:29:45 -0700
commite9fa298d06bdeb267a7931f9b54cd82b3c1e3a1b (patch)
tree76da76d01c0c1fc0740f7c5b415cdc6f3b9253ff
parent2ead52b1398aef218c18d056c5a4da6b1d686ca5 (diff)
downloadsubsurface-e9fa298d06bdeb267a7931f9b54cd82b3c1e3a1b.tar.gz
Cleanup: make qPref::registerQML() static
This member function does not access any other member of the object. Make it static. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/settings/qPref.h2
-rw-r--r--subsurface-helper.cpp2
-rw-r--r--tests/testqPrefDivePlanner.cpp2
-rw-r--r--tests/testqPrefGeneral.cpp2
-rw-r--r--tests/testqPrefGeocoding.cpp2
-rw-r--r--tests/testqPrefTechnicalDetails.cpp2
-rw-r--r--tests/testqml.cpp4
7 files changed, 8 insertions, 8 deletions
diff --git a/core/settings/qPref.h b/core/settings/qPref.h
index 2fee5e29a..7628e1c4a 100644
--- a/core/settings/qPref.h
+++ b/core/settings/qPref.h
@@ -18,7 +18,7 @@ public:
static void sync() { loadSync(true); }
// Register QML
- void registerQML(QQmlEngine *engine);
+ static void registerQML(QQmlEngine *engine);
private:
static void loadSync(bool doSync);
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index 67c8a6dcc..786c2ab03 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -158,7 +158,7 @@ static void register_meta_types()
void register_qml_types(QQmlEngine *engine)
{
// register qPref*
- qPref::instance()->registerQML(engine);
+ qPref::registerQML(engine);
#ifndef SUBSURFACE_TEST_DATA
int rc;
diff --git a/tests/testqPrefDivePlanner.cpp b/tests/testqPrefDivePlanner.cpp
index 0a8812cec..5580acf80 100644
--- a/tests/testqPrefDivePlanner.cpp
+++ b/tests/testqPrefDivePlanner.cpp
@@ -14,7 +14,7 @@ void TestQPrefDivePlanner::initTestCase()
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
QCoreApplication::setApplicationName("SubsurfaceTestQPrefDivePlanner");
- qPref::instance()->registerQML(NULL);
+ qPref::registerQML(NULL);
}
void TestQPrefDivePlanner::test_struct_get()
diff --git a/tests/testqPrefGeneral.cpp b/tests/testqPrefGeneral.cpp
index f3fbbd02b..9e87d4289 100644
--- a/tests/testqPrefGeneral.cpp
+++ b/tests/testqPrefGeneral.cpp
@@ -14,7 +14,7 @@ void TestQPrefGeneral::initTestCase()
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
QCoreApplication::setApplicationName("SubsurfaceTestQPrefGeneral");
- qPref::instance()->registerQML(NULL);
+ qPref::registerQML(NULL);
}
void TestQPrefGeneral::test_struct_get()
diff --git a/tests/testqPrefGeocoding.cpp b/tests/testqPrefGeocoding.cpp
index 8b9f1442e..4be621d80 100644
--- a/tests/testqPrefGeocoding.cpp
+++ b/tests/testqPrefGeocoding.cpp
@@ -14,7 +14,7 @@ void TestQPrefGeocoding::initTestCase()
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
QCoreApplication::setApplicationName("SubsurfaceTestQPrefGeocoding");
- qPref::instance()->registerQML(NULL);
+ qPref::registerQML(NULL);
}
void TestQPrefGeocoding::test_struct_get()
diff --git a/tests/testqPrefTechnicalDetails.cpp b/tests/testqPrefTechnicalDetails.cpp
index ebb36fd75..d1c02543c 100644
--- a/tests/testqPrefTechnicalDetails.cpp
+++ b/tests/testqPrefTechnicalDetails.cpp
@@ -14,7 +14,7 @@ void TestQPrefTechnicalDetails::initTestCase()
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
QCoreApplication::setApplicationName("SubsurfaceTestQPrefTechnicalDetails");
- qPref::instance()->registerQML(NULL);
+ qPref::registerQML(NULL);
}
void TestQPrefTechnicalDetails::test_struct_get()
diff --git a/tests/testqml.cpp b/tests/testqml.cpp
index fcea8dfb1..2c354a536 100644
--- a/tests/testqml.cpp
+++ b/tests/testqml.cpp
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
QMLTestSetup setup;
// register C++ types and classes (but not objects)
- qPref::instance()->registerQML(NULL);
+ qPref::registerQML(NULL);
return quick_test_main_with_setup(argc, argv, "TestQML", nullptr, &setup);
#endif //QT_VERSION
@@ -24,6 +24,6 @@ int main(int argc, char **argv)
void QMLTestSetup::qmlEngineAvailable(QQmlEngine *engine)
{
// register C++ objects (but not types and classes)
- qPref::instance()->registerQML(engine);
+ qPref::registerQML(engine);
};