on xenial help sign in
register the controller as a singleton
commit9c6c813142b7995cd32325e3e2de1c3e29798f0e authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 25 Jul 2013, 19:00 (13 years ago) parentae9aab3
1 file changed+6−1
tests/mocks/GSettings/plugin.cpp+6−1
tests/mocks/GSettings/plugin.cpp+6−1
@@ -19,9 +19,14 @@
1919
2020#include <QtQml>
2121
22+static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23+{
24+ return GSettingsControllerQml::getInstance();
25+}
26+
2227void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
2328{
24− qmlRegisterType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController");
29+ qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider);
2530 qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
2631 qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
2732 "GSettingsSchema can only be used inside of a GSettings component");