on xenial help sign in
adapt to new api
bb0f806Albert Astals Cid
tests/mocks/Unity/CMakeLists.txt+1−1
@@ -7,7 +7,7 @@ add_subdirectory(Notifications)
7add_subdirectory(DashCommunicator)
7add_subdirectory(DashCommunicator)
8
8
9pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
9pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
10−pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=6)
10+pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=7)
11
11
12include_directories(
12include_directories(
13 ${CMAKE_CURRENT_BINARY_DIR}
13 ${CMAKE_CURRENT_BINARY_DIR}
tests/mocks/Unity/fake_scope.cpp+3−3
@@ -181,9 +181,9 @@ void Scope::setNoResultsHint(const QString& str)
181 }
181 }
182}
182}
183
183
184−void Scope::activate(QVariant const& result)
184+void Scope::activate(QVariant const& result, QString const& categoryId)
185{
185{
186− qDebug() << "Called activate on scope" << m_id << "with result" << result;
186+ qDebug() << "Called activate on scope" << m_id << "with result" << result << "and category" << categoryId;
187 if (result.toString() == "Result.2.2") {
187 if (result.toString() == "Result.2.2") {
188 Scopes *scopes = dynamic_cast<Scopes*>(parent());
188 Scopes *scopes = dynamic_cast<Scopes*>(parent());
189 m_openScope = scopes->getScopeFromAll("MockScope9");
189 m_openScope = scopes->getScopeFromAll("MockScope9");
@@ -192,7 +192,7 @@ void Scope::activate(QVariant const& result)
192 }
192 }
193}
193}
194
194
195−PreviewStack* Scope::preview(QVariant const& result)
195+PreviewStack* Scope::preview(QVariant const& result, QString const& categoryId)
196{
196{
197 Q_UNUSED(result);
197 Q_UNUSED(result);
198
198
tests/mocks/Unity/fake_scope.h+2−2
@@ -60,8 +60,8 @@ public:
60 Q_INVOKABLE void setName(const QString &name); // This is not invokable in the Interface, here for testing benefits
60 Q_INVOKABLE void setName(const QString &name); // This is not invokable in the Interface, here for testing benefits
61 Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits
61 Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits
62
62
63− Q_INVOKABLE void activate(QVariant const& result) override;
63+ Q_INVOKABLE void activate(QVariant const& result, QString const& categoryId) override;
64− Q_INVOKABLE PreviewStack* preview(QVariant const& result) override;
64+ Q_INVOKABLE PreviewStack* preview(QVariant const& result, QString const& categoryId) override;
65 Q_INVOKABLE void cancelActivation() override;
65 Q_INVOKABLE void cancelActivation() override;
66 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
66 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
67
67
tests/mocks/Unity/fake_scopesoverview.cpp+1−1
@@ -41,7 +41,7 @@ void ScopesOverview::setSearchQuery(const QString& search_query)
41 Q_EMIT categoriesChanged();
41 Q_EMIT categoriesChanged();
42}
42}
43
43
44−Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
44+Q_INVOKABLE void ScopesOverview::activate(QVariant const& result, QString const& /*categoryId*/)
45{
45{
46 Scopes *scopes = dynamic_cast<Scopes*>(parent());
46 Scopes *scopes = dynamic_cast<Scopes*>(parent());
47 if (scopes->getScope(result.toString())) {
47 if (scopes->getScope(result.toString())) {
tests/mocks/Unity/fake_scopesoverview.h+1−1
@@ -32,7 +32,7 @@ public:
32 ScopesOverview(Scopes* parent = 0);
32 ScopesOverview(Scopes* parent = 0);
33
33
34 void setSearchQuery(const QString& search_query) override;
34 void setSearchQuery(const QString& search_query) override;
35− Q_INVOKABLE void activate(QVariant const& result) override;
35+ Q_INVOKABLE void activate(QVariant const& result, QString const& categoryId) override;
36
36
37 // This is implementation detail
37 // This is implementation detail
38 void setFavorite(Scope *scope, bool favorite);
38 void setFavorite(Scope *scope, bool favorite);