on xenial help sign in
First start of implementing a proper scopes overview in the fake plugin
a28160aAlbert Astals
tests/mocks/Unity/CMakeLists.txt+1
@@ -21,6 +21,7 @@ add_definitions(-DQT_NO_KEYWORDS)
21set(UnityQML_SOURCES
21set(UnityQML_SOURCES
22 fake_scope.cpp
22 fake_scope.cpp
23 fake_scopes.cpp
23 fake_scopes.cpp
24+ fake_scopesoverview.cpp
24 fake_categories.cpp
25 fake_categories.cpp
25 fake_department.cpp
26 fake_department.cpp
26 fake_resultsmodel.cpp
27 fake_resultsmodel.cpp
tests/mocks/Unity/fake_scope.cpp+2−2
@@ -24,7 +24,7 @@ Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
24{
24{
25}
25}
26
26
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)
28 : unity::shell::scopes::ScopeInterface(parent)
28 : unity::shell::scopes::ScopeInterface(parent)
29 , m_id(id)
29 , m_id(id)
30 , m_name(name)
30 , m_name(name)
@@ -33,7 +33,7 @@ Scope::Scope(QString const& id, QString const& name, bool visible, QObject* pare
33 , m_isActive(false)
33 , m_isActive(false)
34 , m_currentDeparment("root")
34 , m_currentDeparment("root")
35 , m_previewRendererName("preview-generic")
35 , m_previewRendererName("preview-generic")
36− , m_categories(new Categories(nCategories, this))
36+ , m_categories(new Categories(20, this))
37{
37{
38}
38}
39
39
tests/mocks/Unity/fake_scope.h+2−2
@@ -30,7 +30,7 @@ class Scope : public unity::shell::scopes::ScopeInterface
30
30
31public:
31public:
32 Scope(QObject* parent = 0);
32 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);
34
34
35 /* getters */
35 /* getters */
36 QString id() const override;
36 QString id() const override;
@@ -82,7 +82,7 @@ protected:
82
82
83 QString m_previewRendererName;
83 QString m_previewRendererName;
84
84
85− Categories* m_categories;
85+ unity::shell::scopes::CategoriesInterface* m_categories;
86};
86};
87
87
88#endif // FAKE_SCOPE_H
88#endif // FAKE_SCOPE_H
tests/mocks/Unity/fake_scopes.cpp+2−1
@@ -18,6 +18,7 @@
18
18
19// Self
19// Self
20#include "fake_scopes.h"
20#include "fake_scopes.h"
21+#include "fake_scopesoverview.h"
21
22
22// TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings)
23// TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings)
23
24
@@ -46,7 +47,7 @@ void Scopes::updateScopes()
46 addScope(new Scope("MockScope2", "Music", false, this));
47 addScope(new Scope("MockScope2", "Music", false, this));
47 addScope(new Scope("clickscope", "Apps", true, this));
48 addScope(new Scope("clickscope", "Apps", true, this));
48 addScope(new Scope("MockScope5", "Videos", true, this));
49 addScope(new Scope("MockScope5", "Videos", true, this));
49− addScope(new Scope("scopesOverview", "Scopes Overview", false, this, 2));
50+ addScope(new ScopesOverview());
50
51
51 if (!m_loaded) {
52 if (!m_loaded) {
52 m_loaded = true;
53 m_loaded = true;