on xenial help sign in
added empty function
b9c6b58Andrea Cimitan
tests/mocks/GSettings/fake_gsettings.cpp+3
@@ -45,6 +45,9 @@ GSettingsControllerQml* GSettingsControllerQml::getInstance() {
45 }
45 }
46}
46}
47
47
48+void GSettingsControllerQml::setPictureUri(const QString &str) {
49+}
50+
48GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
51GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
49 priv = new GSettingsSchemaQmlPrivate;
52 priv = new GSettingsSchemaQmlPrivate;
50}
53}
tests/mocks/GSettings/fake_gsettings.h+3−1
@@ -28,6 +28,8 @@ public:
28 static GSettingsControllerQml* getInstance();
28 static GSettingsControllerQml* getInstance();
29 ~GSettingsControllerQml();
29 ~GSettingsControllerQml();
30
30
31+ void setPictureUri(const QString &str);
32+
31private:
33private:
32 GSettingsControllerQml();
34 GSettingsControllerQml();
33 GSettingsControllerQml(const GSettingsControllerQml&);
35 GSettingsControllerQml(const GSettingsControllerQml&);
@@ -72,7 +74,7 @@ public:
72 GSettingsSchemaQml * schema() const;
74 GSettingsSchemaQml * schema() const;
73 QString pictureUri() const;
75 QString pictureUri() const;
74
76
75− void setPictureUri(const QString &str);
77+ void setPictureUric
76
78
77Q_SIGNALS:
79Q_SIGNALS:
78 void schemaChanged();
80 void schemaChanged();
tests/mocks/GSettings/plugin.cpp+6−1
@@ -19,9 +19,14 @@
19
19
20#include <QtQml>
20#include <QtQml>
21
21
22+static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23+{
24+ return GSettingsControllerQml::getInstance();
25+}
26+
22void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
27void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
23{
28{
24− qmlRegisterType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController");
29+ qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider);
25 qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
30 qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
26 qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
31 qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
27 "GSettingsSchema can only be used inside of a GSettings component");
32 "GSettingsSchema can only be used inside of a GSettings component");
tests/qmltests/tst_Shell.qml+5
@@ -27,6 +27,11 @@ import "../.."
27
27
28Shell {
28Shell {
29 id: shell
29 id: shell
30+
31+ GSettingsController {
32+ id: gsettingsController
33+ }
34+
30 UT.UnityTestCase {
35 UT.UnityTestCase {
31 name: "Shell"
36 name: "Shell"
32 when: windowShown
37 when: windowShown