on xenial help sign in
First start of implementing a proper scopes overview in the fake plugin

Still work to do in the results of the categories

commita28160a28db4f17f4898ba5ce40e6622f6045114 authorAlbert Astals <albert.astals@canonical.com> dateWed 9 Jul 2014, 17:52 (12 years ago) parent0aef820
4 files changed+7−5
tests/mocks/Unity/CMakeLists.txt+1 tests/mocks/Unity/fake_scope.cpp+2−2 tests/mocks/Unity/fake_scope.h+2−2 tests/mocks/Unity/fake_scopes.cpp+2−1
tests/mocks/Unity/CMakeLists.txt+1
@@ -21,6 +21,7 @@ add_definitions(-DQT_NO_KEYWORDS)
2121set(UnityQML_SOURCES
2222 fake_scope.cpp
2323 fake_scopes.cpp
24+ fake_scopesoverview.cpp
2425 fake_categories.cpp
2526 fake_department.cpp
2627 fake_resultsmodel.cpp
tests/mocks/Unity/fake_scope.cpp+2−2
@@ -24,7 +24,7 @@ Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
2424{
2525}
2626
27−Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent, int nCategories)
27+Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
2828 : unity::shell::scopes::ScopeInterface(parent)
2929 , m_id(id)
3030 , m_name(name)
@@ -33,7 +33,7 @@ Scope::Scope(QString const& id, QString const& name, bool visible, QObject* pare
3333 , m_isActive(false)
3434 , m_currentDeparment("root")
3535 , m_previewRendererName("preview-generic")
36− , m_categories(new Categories(nCategories, this))
36+ , m_categories(new Categories(20, this))
3737{
3838}
3939
tests/mocks/Unity/fake_scope.h+2−2
@@ -30,7 +30,7 @@ class Scope : public unity::shell::scopes::ScopeInterface
3030
3131public:
3232 Scope(QObject* parent = 0);
33− Scope(QString const& id, QString const& name, bool visible, QObject* parent = 0, int nCategories = 20);
33+ Scope(QString const& id, QString const& name, bool visible, QObject* parent = 0);
3434
3535 /* getters */
3636 QString id() const override;
@@ -82,7 +82,7 @@ protected:
8282
8383 QString m_previewRendererName;
8484
85− Categories* m_categories;
85+ unity::shell::scopes::CategoriesInterface* m_categories;
8686};
8787
8888#endif // FAKE_SCOPE_H
tests/mocks/Unity/fake_scopes.cpp+2−1
@@ -18,6 +18,7 @@
1818
1919// Self
2020#include "fake_scopes.h"
21+#include "fake_scopesoverview.h"
2122
2223// TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings)
2324
@@ -46,7 +47,7 @@ void Scopes::updateScopes()
4647 addScope(new Scope("MockScope2", "Music", false, this));
4748 addScope(new Scope("clickscope", "Apps", true, this));
4849 addScope(new Scope("MockScope5", "Videos", true, this));
49− addScope(new Scope("scopesOverview", "Scopes Overview", false, this, 2));
50+ addScope(new ScopesOverview());
5051
5152 if (!m_loaded) {
5253 m_loaded = true;