on xenial help sign in
And forgot i need this too
2485b4fAlbert Astals Cid
tests/mocks/Unity/fake_scope.cpp+9
@@ -310,3 +310,12 @@ void Scope::setNavigationState(const QString &navigationId, bool isAltNavigation
310 Q_EMIT currentNavigationIdChanged();
310 Q_EMIT currentNavigationIdChanged();
311 }
311 }
312}
312}
313+
314+void Scope::performQuery(const QString& query)
315+{
316+ Q_EMIT queryPerformed(query);
317+ if (query.startsWith("scopes://")) {
318+ QString scopeId = query.mid(9);
319+ Q_EMIT gotoScope(scopeId);
320+ }
321+}
tests/mocks/Unity/fake_scope.h+4−2
@@ -72,7 +72,7 @@ public:
72 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override;
72 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override;
73 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override;
73 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override;
74 Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override;
74 Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override;
75− Q_SIGNAL void performQuery(const QString& query) override;
75+ void performQuery(const QString& query) override;
76
76
77 Status status() const override;
77 Status status() const override;
78 QVariantMap customizations() const override;
78 QVariantMap customizations() const override;
@@ -80,7 +80,9 @@ public:
80 Q_INVOKABLE void refresh() override;
80 Q_INVOKABLE void refresh() override;
81
81
82Q_SIGNALS:
82Q_SIGNALS:
83− void refreshed(); // This is not in the Interface, here for testing benefits
83+ // These are not in the Interface, here for testing benefits
84+ void refreshed();
85+ void queryPerformed(const QString& query);
84
86
85protected:
87protected:
86
88
tests/qmltests/Dash/tst_Dash.qml+1−1
@@ -315,7 +315,7 @@ Item {
315
315
316 var scopesList = findChild(dash, "scopesList");
316 var scopesList = findChild(dash, "scopesList");
317 spy.target = scopesList.scope;
317 spy.target = scopesList.scope;
318− spy.signalName = "performQuery";
318+ spy.signalName = "queryPerformed";
319
319
320 // Click on the store
320 // Click on the store
321 var scopesListPageHeader = findChild(scopesList, "pageHeader");
321 var scopesListPageHeader = findChild(scopesList, "pageHeader");
tests/qmltests/Dash/tst_GenericScopeView.qml+1−1
@@ -206,7 +206,7 @@ Item {
206 var header = findChild(genericScopeView, "dashSectionHeader1");
206 var header = findChild(genericScopeView, "dashSectionHeader1");
207
207
208 spy.target = genericScopeView.scope;
208 spy.target = genericScopeView.scope;
209− spy.signalName = "performQuery";
209+ spy.signalName = "queryPerformed";
210
210
211 mouseClick(header);
211 mouseClick(header);
212
212