on xenial help sign in
Remove unused mock setting and add missing oskSwitchVisible setting.
ee1fffaRodney Dawes
tests/mocks/GSettings.1.0/fake_gsettings.cpp+22−5
@@ -28,7 +28,7 @@ GSettingsControllerQml::GSettingsControllerQml()
28 , m_launcherWidth(8)
28 , m_launcherWidth(8)
29 , m_edgeDragWidth(2)
29 , m_edgeDragWidth(2)
30 , m_enableIndicatorMenu(true)
30 , m_enableIndicatorMenu(true)
31− , m_appstoreUri("http://uappexplorer.com")
31+ , m_oskSwitchVisible(false)
32{
32{
33}
33}
34
34
@@ -160,9 +160,17 @@ void GSettingsControllerQml::setEnableIndicatorMenu(bool enableIndicatorMenu)
160 }
160 }
161}
161}
162
162
163−QString GSettingsControllerQml::appstoreUri() const
163+bool GSettingsControllerQml::oskSwitchVisible() const
164{
164{
165− return m_appstoreUri;
165+ return m_oskSwitchVisible;
166+}
167+
168+void GSettingsControllerQml::setOskSwitchVisible(bool oskSwitchVisible)
169+{
170+ if (m_oskSwitchVisible != oskSwitchVisible) {
171+ m_oskSwitchVisible = oskSwitchVisible;
172+ Q_EMIT oskSwitchVisibleChanged(oskSwitchVisible);
173+ }
166}
174}
167
175
168GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
176GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
@@ -231,6 +239,8 @@ void GSettingsQml::componentComplete()
231 this, &GSettingsQml::edgeDragWidthChanged);
239 this, &GSettingsQml::edgeDragWidthChanged);
232 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableIndicatorMenuChanged,
240 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableIndicatorMenuChanged,
233 this, &GSettingsQml::enableIndicatorMenuChanged);
241 this, &GSettingsQml::enableIndicatorMenuChanged);
242+ connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::oskSwitchVisibleChanged,
243+ this, &GSettingsQml::oskSwitchVisibleChanged);
234
244
235 Q_EMIT disableHeightChanged();
245 Q_EMIT disableHeightChanged();
236 Q_EMIT pictureUriChanged();
246 Q_EMIT pictureUriChanged();
@@ -356,10 +366,10 @@ QVariant GSettingsQml::enableIndicatorMenu() const
356 }
366 }
357}
367}
358
368
359−QVariant GSettingsQml::appstoreUri() const
369+QVariant GSettingsQml::oskSwitchVisible() const
360{
370{
361 if (m_valid && m_schema->id() == "com.canonical.Unity8") {
371 if (m_valid && m_schema->id() == "com.canonical.Unity8") {
362− return GSettingsControllerQml::instance()->appstoreUri();
372+ return GSettingsControllerQml::instance()->oskSwitchVisible();
363 }
373 }
364 return QVariant();
374 return QVariant();
365}
375}
@@ -398,3 +408,10 @@ void GSettingsQml::setEnableIndicatorMenu(const QVariant &enableIndicatorMenu)
398 GSettingsControllerQml::instance()->setEnableIndicatorMenu(enableIndicatorMenu.toBool());
408 GSettingsControllerQml::instance()->setEnableIndicatorMenu(enableIndicatorMenu.toBool());
399 }
409 }
400}
410}
411+
412+void GSettingsQml::setOskSwitchVisible(const QVariant &oskSwitchVisible)
413+{
414+ if (m_valid && m_schema->id() == "com.canonical.Unity8") {
415+ GSettingsControllerQml::instance()->setOskSwitchVisible(oskSwitchVisible.toBool());
416+ }
417+}
tests/mocks/GSettings.1.0/fake_gsettings.h+8−6
@@ -58,7 +58,7 @@ class GSettingsQml: public QObject, public QQmlParserStatus
58 Q_PROPERTY(QVariant launcherWidth READ launcherWidth WRITE setLauncherWidth NOTIFY launcherWidthChanged)
58 Q_PROPERTY(QVariant launcherWidth READ launcherWidth WRITE setLauncherWidth NOTIFY launcherWidthChanged)
59 Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged)
59 Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged)
60 Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged)
60 Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged)
61− Q_PROPERTY(QVariant appstoreUri READ appstoreUri NOTIFY appstoreUriChanged)
61+ Q_PROPERTY(QVariant oskSwitchVisible READ oskSwitchVisible WRITE setOskSwitchVisible NOTIFY oskSwitchVisibleChanged)
62
62
63public:
63public:
64 GSettingsQml(QObject *parent = nullptr);
64 GSettingsQml(QObject *parent = nullptr);
@@ -76,7 +76,7 @@ public:
76 QVariant launcherWidth() const;
76 QVariant launcherWidth() const;
77 QVariant edgeDragWidth() const;
77 QVariant edgeDragWidth() const;
78 QVariant enableIndicatorMenu() const;
78 QVariant enableIndicatorMenu() const;
79− QVariant appstoreUri() const;
79+ QVariant oskSwitchVisible() const;
80
80
81 void setDisableHeight(const QVariant &val);
81 void setDisableHeight(const QVariant &val);
82 void setPictureUri(const QVariant &str);
82 void setPictureUri(const QVariant &str);
@@ -87,6 +87,7 @@ public:
87 void setLauncherWidth(const QVariant &launcherWidth);
87 void setLauncherWidth(const QVariant &launcherWidth);
88 void setEdgeDragWidth(const QVariant &edgeDragWidth);
88 void setEdgeDragWidth(const QVariant &edgeDragWidth);
89 void setEnableIndicatorMenu(const QVariant &enableIndicatorMenu);
89 void setEnableIndicatorMenu(const QVariant &enableIndicatorMenu);
90+ void setOskSwitchVisible(const QVariant &oskSwitchVisible);
90
91
91Q_SIGNALS:
92Q_SIGNALS:
92 void disableHeightChanged();
93 void disableHeightChanged();
@@ -99,7 +100,7 @@ Q_SIGNALS:
99 void launcherWidthChanged();
100 void launcherWidthChanged();
100 void edgeDragWidthChanged();
101 void edgeDragWidthChanged();
101 void enableIndicatorMenuChanged();
102 void enableIndicatorMenuChanged();
102− void appstoreUriChanged();
103+ void oskSwitchVisibleChanged();
103
104
104private:
105private:
105 GSettingsSchemaQml* m_schema;
106 GSettingsSchemaQml* m_schema;
@@ -143,7 +144,8 @@ public:
143 bool enableIndicatorMenu() const;
144 bool enableIndicatorMenu() const;
144 Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu);
145 Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu);
145
146
146− QString appstoreUri() const;
147+ bool oskSwitchVisible() const;
148+ Q_INVOKABLE void setOskSwitchVisible(bool oskSwitchVisible);
147
149
148Q_SIGNALS:
150Q_SIGNALS:
149 void disableHeightChanged();
151 void disableHeightChanged();
@@ -155,7 +157,7 @@ Q_SIGNALS:
155 void launcherWidthChanged(int launcherWidth);
157 void launcherWidthChanged(int launcherWidth);
156 void edgeDragWidthChanged(uint edgeDragWidth);
158 void edgeDragWidthChanged(uint edgeDragWidth);
157 void enableIndicatorMenuChanged(bool enableIndicatorMenu);
159 void enableIndicatorMenuChanged(bool enableIndicatorMenu);
158− void appstoreUriChanged(const QString &appstoreUri);
160+ void oskSwitchVisibleChanged(bool oskSwitchVisible);
159
161
160private:
162private:
161 GSettingsControllerQml();
163 GSettingsControllerQml();
@@ -169,7 +171,7 @@ private:
169 int m_launcherWidth;
171 int m_launcherWidth;
170 uint m_edgeDragWidth;
172 uint m_edgeDragWidth;
171 bool m_enableIndicatorMenu;
173 bool m_enableIndicatorMenu;
172− QString m_appstoreUri;
174+ bool m_oskSwitchVisible;
173
175
174 static GSettingsControllerQml* s_controllerInstance;
176 static GSettingsControllerQml* s_controllerInstance;
175 QList<GSettingsQml *> m_registeredGSettings;
177 QList<GSettingsQml *> m_registeredGSettings;