on xenial help sign in
added empty function
commitb9c6b583eedae98c6a5a868ad030785522569cf4 authorAndrea Cimitan <andrea.cimitan@canonical.com> dateFri 26 Jul 2013, 10:00 (13 years ago) parentae9aab39c6c813
4 files changed+17−2
tests/mocks/GSettings/fake_gsettings.cpp+3 tests/mocks/GSettings/fake_gsettings.h+3−1 tests/mocks/GSettings/plugin.cpp+6−1 tests/qmltests/tst_Shell.qml+5
tests/mocks/GSettings/fake_gsettings.cpp+3
@@ -45,6 +45,9 @@ GSettingsControllerQml* GSettingsControllerQml::getInstance() {
4545 }
4646}
4747
48+void GSettingsControllerQml::setPictureUri(const QString &str) {
49+}
50+
4851GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
4952 priv = new GSettingsSchemaQmlPrivate;
5053}
tests/mocks/GSettings/fake_gsettings.h+3−1
@@ -28,6 +28,8 @@ public:
2828 static GSettingsControllerQml* getInstance();
2929 ~GSettingsControllerQml();
3030
31+ void setPictureUri(const QString &str);
32+
3133private:
3234 GSettingsControllerQml();
3335 GSettingsControllerQml(const GSettingsControllerQml&);
@@ -72,7 +74,7 @@ public:
7274 GSettingsSchemaQml * schema() const;
7375 QString pictureUri() const;
7476
75− void setPictureUri(const QString &str);
77+ void setPictureUric
7678
7779Q_SIGNALS:
7880 void schemaChanged();
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");
tests/qmltests/tst_Shell.qml+5
@@ -27,6 +27,11 @@ import "../.."
2727
2828Shell {
2929 id: shell
30+
31+ GSettingsController {
32+ id: gsettingsController
33+ }
34+
3035 UT.UnityTestCase {
3136 name: "Shell"
3237 when: windowShown