on xenial help sign in
Fix FTBFS when using latest unity-api.
80cb348Michal Hruby
debian/control+1−1
@@ -19,7 +19,7 @@ Build-Depends: cmake,
19 libpulse-dev,
19 libpulse-dev,
20 libqmenumodel-dev (>= 0.2.7),
20 libqmenumodel-dev (>= 0.2.7),
21 libqt5xmlpatterns5-dev,
21 libqt5xmlpatterns5-dev,
22− libunity-api-dev (>= 7.83),
22+ libunity-api-dev (>= 7.85),
23 libunity-mir-dev,
23 libunity-mir-dev,
24 libusermetricsoutput1-dev,
24 libusermetricsoutput1-dev,
25 libxcb1-dev,
25 libxcb1-dev,
tests/mocks/Unity/CMakeLists.txt+1−1
@@ -6,7 +6,7 @@ add_subdirectory(Notifications)
6pkg_search_module(DEE dee-1.0 REQUIRED)
6pkg_search_module(DEE dee-1.0 REQUIRED)
7pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
7pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
8pkg_search_module(DEEQT libdee-qt5 REQUIRED)
8pkg_search_module(DEEQT libdee-qt5 REQUIRED)
9−pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=1)
9+pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=2)
10
10
11include_directories(
11include_directories(
12 ${CMAKE_CURRENT_BINARY_DIR}
12 ${CMAKE_CURRENT_BINARY_DIR}
tests/mocks/Unity/fake_categories.cpp+4
@@ -116,6 +116,8 @@ Categories::data(const QModelIndex& index, int role) const
116 map["title"] = "HOLA";
116 map["title"] = "HOLA";
117 return map;
117 return map;
118 }
118 }
119+ case RoleHeaderLink:
120+ return QString();
119 case RoleResults:
121 case RoleResults:
120 return QVariant();
122 return QVariant();
121 case RoleCount:
123 case RoleCount:
@@ -163,6 +165,8 @@ Categories::data(const QModelIndex& index, int role) const
163 map["subtitle"] = "HOLA";
165 map["subtitle"] = "HOLA";
164 return map;
166 return map;
165 }
167 }
168+ case RoleHeaderLink:
169+ return QString();
166 case RoleResults:
170 case RoleResults:
167 return QVariant::fromValue(resultsModel);
171 return QVariant::fromValue(resultsModel);
168 case RoleCount:
172 case RoleCount:
tests/mocks/Unity/fake_scope.cpp+46−18
@@ -35,87 +35,110 @@ Scope::Scope(QString const& id, QString const& name, bool visible, QObject* pare
35{
35{
36}
36}
37
37
38−QString Scope::id() const {
38+QString Scope::id() const
39+{
39 return m_id;
40 return m_id;
40}
41}
41
42
42−QString Scope::name() const {
43+QString Scope::name() const
44+{
43 return m_name;
45 return m_name;
44}
46}
45
47
46−QString Scope::searchQuery() const {
48+QString Scope::searchQuery() const
49+{
47 return m_searchQuery;
50 return m_searchQuery;
48}
51}
49
52
50−QString Scope::iconHint() const {
53+QString Scope::iconHint() const
54+{
51 return m_iconHint;
55 return m_iconHint;
52}
56}
53
57
54−QString Scope::description() const {
58+QString Scope::description() const
59+{
55 return m_description;
60 return m_description;
56}
61}
57
62
58−QString Scope::searchHint() const {
63+QString Scope::searchHint() const
64+{
59 return QString("");
65 return QString("");
60}
66}
61
67
62−QString Scope::shortcut() const {
68+QString Scope::shortcut() const
69+{
63 return QString("");
70 return QString("");
64}
71}
65
72
66−bool Scope::searchInProgress() const {
73+bool Scope::searchInProgress() const
74+{
67 return m_searching;
75 return m_searching;
68}
76}
69
77
70−unity::shell::scopes::CategoriesInterface* Scope::categories() const {
78+unity::shell::scopes::CategoriesInterface* Scope::categories() const
79+{
71 return m_categories;
80 return m_categories;
72}
81}
73
82
83+unity::shell::scopes::SettingsModelInterface* Scope::settings() const
84+{
85+ return nullptr;
86+}
87+
74−QString Scope::noResultsHint() const {
88+QString Scope::noResultsHint() const
89+{
75 return m_noResultsHint;
90 return m_noResultsHint;
76}
91}
77
92
78−QString Scope::formFactor() const {
93+QString Scope::formFactor() const
94+{
79 return m_formFactor;
95 return m_formFactor;
80}
96}
81
97
82−bool Scope::visible() const {
98+bool Scope::visible() const
99+{
83 return m_visible;
100 return m_visible;
84}
101}
85
102
86−bool Scope::isActive() const {
103+bool Scope::isActive() const
104+{
87 return m_isActive;
105 return m_isActive;
88}
106}
89
107
90−void Scope::setSearchQuery(const QString &str) {
108+void Scope::setSearchQuery(const QString &str)
109+{
91 if (str != m_searchQuery) {
110 if (str != m_searchQuery) {
92 m_searchQuery = str;
111 m_searchQuery = str;
93 Q_EMIT searchQueryChanged();
112 Q_EMIT searchQueryChanged();
94 }
113 }
95}
114}
96
115
97−void Scope::setFormFactor(const QString &str) {
116+void Scope::setFormFactor(const QString &str)
117+{
98 if (str != m_formFactor) {
118 if (str != m_formFactor) {
99 m_formFactor = str;
119 m_formFactor = str;
100 Q_EMIT formFactorChanged();
120 Q_EMIT formFactorChanged();
101 }
121 }
102}
122}
103
123
104−void Scope::setActive(const bool active) {
124+void Scope::setActive(const bool active)
125+{
105 if (active != m_isActive) {
126 if (active != m_isActive) {
106 m_isActive = active;
127 m_isActive = active;
107 Q_EMIT isActiveChanged();
128 Q_EMIT isActiveChanged();
108 }
129 }
109}
130}
110
131
111−void Scope::setSearchInProgress(const bool inProg) {
132+void Scope::setSearchInProgress(const bool inProg)
133+{
112 if (inProg != m_searching) {
134 if (inProg != m_searching) {
113 m_searching = inProg;
135 m_searching = inProg;
114 Q_EMIT searchInProgressChanged();
136 Q_EMIT searchInProgressChanged();
115 }
137 }
116}
138}
117
139
118−void Scope::setNoResultsHint(const QString& str) {
140+void Scope::setNoResultsHint(const QString& str)
141+{
119 if (str != m_noResultsHint) {
142 if (str != m_noResultsHint) {
120 m_noResultsHint = str;
143 m_noResultsHint = str;
121 Q_EMIT noResultsHintChanged();
144 Q_EMIT noResultsHintChanged();
@@ -182,3 +205,8 @@ void Scope::loadDepartment(const QString& id)
182 m_currentDeparment = id;
205 m_currentDeparment = id;
183 Q_EMIT currentDepartmentIdChanged();
206 Q_EMIT currentDepartmentIdChanged();
184}
207}
208+
209+void Scope::performQuery(const QString& query)
210+{
211+ Q_UNUSED(query);
212+}
tests/mocks/Unity/fake_scope.h+2
@@ -46,6 +46,7 @@ public:
46 QString noResultsHint() const override;
46 QString noResultsHint() const override;
47 QString formFactor() const override;
47 QString formFactor() const override;
48 bool isActive() const override;
48 bool isActive() const override;
49+ unity::shell::scopes::SettingsModelInterface* settings() const override;
49
50
50 /* setters */
51 /* setters */
51 void setSearchQuery(const QString& search_query) override;
52 void setSearchQuery(const QString& search_query) override;
@@ -63,6 +64,7 @@ public:
63 bool hasDepartments() const override;
64 bool hasDepartments() const override;
64 Q_INVOKABLE unity::shell::scopes::DepartmentInterface* getDepartment(const QString& id) override;
65 Q_INVOKABLE unity::shell::scopes::DepartmentInterface* getDepartment(const QString& id) override;
65 Q_INVOKABLE void loadDepartment(const QString& id) override;
66 Q_INVOKABLE void loadDepartment(const QString& id) override;
67+ Q_INVOKABLE void performQuery(const QString& query) override;
66
68
67 QVariantMap customizations() const override;
69 QVariantMap customizations() const override;
68
70