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>
This commit is contained in:
Berthold Stoeger 2019-04-03 23:28:26 +02:00 committed by Dirk Hohndel
parent 2ead52b139
commit e9fa298d06
7 changed files with 8 additions and 8 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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);
};