Merge lp:~stolowski/unity-scope-click/update-for-api-0.5.0 into lp:unity-scope-click/devel

Proposed by Paweł Stołowski
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~stolowski/unity-scope-click/update-for-api-0.5.0
Merge into: lp:unity-scope-click/devel
Diff against target: 340 lines (+49/-47)
11 files modified
CMakeLists.txt (+1/-1)
debian/control (+1/-1)
libclickscope/click/preview.cpp (+1/-0)
libclickscope/click/scope_activation.cpp (+11/-5)
libclickscope/click/scope_activation.h (+2/-2)
scope/clickapps/apps-query.cpp (+11/-12)
scope/clickapps/apps-scope.cpp (+5/-6)
scope/clickapps/apps-scope.h (+3/-3)
scope/clickstore/store-query.cpp (+9/-10)
scope/clickstore/store-scope.cpp (+3/-5)
scope/clickstore/store-scope.h (+2/-2)
To merge this branch: bzr merge lp:~stolowski/unity-scope-click/update-for-api-0.5.0
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+223549@code.launchpad.net

Commit message

Updated for new scopes API 0.5.0

Description of the change

Updated for new scopes API 0.5.0

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
296. By Paweł Stołowski

Updated start() method.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
297. By Paweł Stołowski

More updates for new API.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
dobey (dobey) :
review: Needs Fixing
298. By Paweł Stołowski

Removed test_data.cpp.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
dobey (dobey) wrote :

I'm going to reject this, as this is the same branch that was merged to trunk for the api break already. Instead, we should merge from trunk back to devel, to get the other changes that happened when merging to trunk (the debian/changelog updates for example).

review: Disapprove

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-05-27 13:15:52 +0000
3+++ CMakeLists.txt 2014-06-18 17:38:31 +0000
4@@ -21,7 +21,7 @@
5
6 include(FindPkgConfig)
7
8-pkg_check_modules(UNITY_SCOPES REQUIRED libunity-scopes>=0.4.0 libunity-api>=0.1.3)
9+pkg_check_modules(UNITY_SCOPES REQUIRED libunity-scopes>=0.5.0 libunity-api>=0.1.3)
10 add_definitions(${UNITY_SCOPES_CFLAGS} ${UNITY_SCOPES_CFLAGS_OTHER})
11
12 find_package (PkgConfig REQUIRED)
13
14=== modified file 'debian/control'
15--- debian/control 2014-06-13 15:21:16 +0000
16+++ debian/control 2014-06-18 17:38:31 +0000
17@@ -13,7 +13,7 @@
18 libubuntu-download-manager-common-dev (>= 0.3+14.10.20140430-0ubuntu1),
19 libubuntuoneauth-2.0-dev,
20 libunity-api-dev (>= 7.80.7),
21- libunity-scopes-dev (>= 0.4.0),
22+ libunity-scopes-dev (>= 0.5.0),
23 pkg-config,
24 python3-all,
25 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26
27=== modified file 'libclickscope/click/preview.cpp'
28--- libclickscope/click/preview.cpp 2014-06-16 14:09:21 +0000
29+++ libclickscope/click/preview.cpp 2014-06-18 17:38:31 +0000
30@@ -57,6 +57,7 @@
31 const unity::scopes::ActionMetadata& metadata,
32 const QSharedPointer<click::web::Client>& client,
33 const QSharedPointer<click::network::AccessManager>& nam)
34+ : PreviewQueryBase(result, metadata)
35 {
36 strategy.reset(choose_strategy(result, metadata, client, nam));
37 }
38
39=== modified file 'libclickscope/click/scope_activation.cpp'
40--- libclickscope/click/scope_activation.cpp 2014-05-28 07:42:24 +0000
41+++ libclickscope/click/scope_activation.cpp 2014-06-18 17:38:31 +0000
42@@ -33,6 +33,11 @@
43 #include <click/qtbridge.h>
44 #include <unity/scopes/ActivationResponse.h>
45
46+click::ScopeActivation::ScopeActivation(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata)
47+ : unity::scopes::ActivationQueryBase(result, metadata)
48+{
49+}
50+
51 unity::scopes::ActivationResponse click::ScopeActivation::activate()
52 {
53 auto response = unity::scopes::ActivationResponse(status_);
54@@ -50,18 +55,19 @@
55 hints_[key] = value;
56 }
57
58-click::PerformUninstallAction::PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActivationResponse& response)
59- : result(result),
60+click::PerformUninstallAction::PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata, const unity::scopes::ActivationResponse& response)
61+ : unity::scopes::ActivationQueryBase(result, metadata),
62 response(response)
63 {
64 }
65
66 unity::scopes::ActivationResponse click::PerformUninstallAction::activate()
67 {
68+ auto const res = result();
69 click::Package package;
70- package.title = result.title();
71- package.name = result["name"].get_string();
72- package.version = result["version"].get_string();
73+ package.title = res.title();
74+ package.name = res["name"].get_string();
75+ package.version = res["version"].get_string();
76 qt::core::world::enter_with_task([this, package] ()
77 {
78 click::PackageManager manager;
79
80=== modified file 'libclickscope/click/scope_activation.h'
81--- libclickscope/click/scope_activation.h 2014-05-28 07:42:24 +0000
82+++ libclickscope/click/scope_activation.h 2014-06-18 17:38:31 +0000
83@@ -40,11 +40,10 @@
84 class PerformUninstallAction: public unity::scopes::ActivationQueryBase
85 {
86 public:
87- PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActivationResponse& response);
88+ PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata, const unity::scopes::ActivationResponse& response);
89 unity::scopes::ActivationResponse activate() override;
90
91 private:
92- unity::scopes::Result result;
93 unity::scopes::ActivationResponse response;
94 };
95
96@@ -53,6 +52,7 @@
97 unity::scopes::ActivationResponse activate() override;
98
99 public:
100+ ScopeActivation(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata);
101 void setStatus(unity::scopes::ActivationResponse::Status status);
102 void setHint(std::string key, unity::scopes::Variant value);
103
104
105=== removed file 'libclickscope/tests/test_data.cpp'
106=== modified file 'scope/clickapps/apps-query.cpp'
107--- scope/clickapps/apps-query.cpp 2014-06-10 21:09:52 +0000
108+++ scope/clickapps/apps-query.cpp 2014-06-18 17:38:31 +0000
109@@ -128,25 +128,24 @@
110
111 struct click::Query::Private
112 {
113- Private(const unity::scopes::CannedQuery& query, click::Index& index, const scopes::SearchMetadata& metadata)
114- : query(query),
115- index(index),
116+ Private(click::Index& index, const scopes::SearchMetadata& metadata)
117+ : index(index),
118 meta(metadata)
119 {
120 }
121- unity::scopes::CannedQuery query;
122 click::Index& index;
123 scopes::SearchMetadata meta;
124 };
125
126 click::Query::Query(unity::scopes::CannedQuery const& query, click::Index& index, scopes::SearchMetadata const& metadata)
127- : impl(new Private(query, index, metadata))
128+ : unity::scopes::SearchQueryBase(query, metadata),
129+ impl(new Private(index, metadata))
130 {
131 }
132
133 void click::Query::cancelled()
134 {
135- qDebug() << "cancelling search of" << QString::fromStdString(impl->query.query_string());
136+ qDebug() << "cancelling search of" << QString::fromStdString(query().query_string());
137 }
138
139 click::Query::~Query()
140@@ -171,10 +170,10 @@
141 static const std::string title = _("Get more apps in Ubuntu store");
142 auto name = title;
143
144- std::string query = impl->query.query_string();
145- std::transform(query.begin(), query.end(), query.begin(), ::tolower);
146+ std::string querystr = query().query_string();
147+ std::transform(querystr.begin(), querystr.end(), querystr.begin(), ::tolower);
148 std::transform(name.begin(), name.end(), name.begin(), ::tolower);
149- if (query.empty() || name.find(query) != std::string::npos)
150+ if (querystr.empty() || name.find(querystr) != std::string::npos)
151 {
152 scopes::CategoryRenderer rdr(CATEGORY_STORE);
153 auto cat = searchReply->register_category("store", "", "", rdr);
154@@ -196,13 +195,13 @@
155
156 void click::Query::run(scopes::SearchReplyProxy const& searchReply)
157 {
158- auto query = impl->query.query_string();
159+ auto querystr = query().query_string();
160 std::string categoryTemplate = CATEGORY_APPS_SEARCH;
161- if (query.empty()) {
162+ if (querystr.empty()) {
163 categoryTemplate = CATEGORY_APPS_DISPLAY;
164 }
165 auto localResults = clickInterfaceInstance().find_installed_apps(
166- query);
167+ querystr);
168
169 push_local_results(
170 searchReply,
171
172=== modified file 'scope/clickapps/apps-scope.cpp'
173--- scope/clickapps/apps-scope.cpp 2014-06-12 14:26:26 +0000
174+++ scope/clickapps/apps-scope.cpp 2014-06-18 17:38:31 +0000
175@@ -54,13 +54,11 @@
176 {
177 }
178
179-int click::Scope::start(std::string const&, scopes::RegistryProxy const&)
180+void click::Scope::start(std::string const&, scopes::RegistryProxy const&)
181 {
182 setlocale(LC_ALL, "");
183 bindtextdomain(GETTEXT_PACKAGE, GETTEXT_LOCALEDIR);
184 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
185-
186- return VERSION;
187 }
188
189 void click::Scope::run()
190@@ -91,14 +89,15 @@
191 }
192
193
194-unity::scopes::ActivationQueryBase::UPtr click::Scope::perform_action(unity::scopes::Result const& result, unity::scopes::ActionMetadata const& metadata, std::string const& /* widget_id */, std::string const& action_id)
195+unity::scopes::ActivationQueryBase::UPtr click::Scope::perform_action(unity::scopes::Result const& result, unity::scopes::ActionMetadata const& metadata,
196+ std::string const& /* widget_id */, std::string const& action_id)
197 {
198 if (action_id == click::Preview::Actions::CONFIRM_UNINSTALL) {
199 const unity::scopes::CannedQuery cquery("clickscope");
200- return scopes::ActivationQueryBase::UPtr(new PerformUninstallAction(result, unity::scopes::ActivationResponse(cquery)));
201+ return scopes::ActivationQueryBase::UPtr(new PerformUninstallAction(result, metadata, unity::scopes::ActivationResponse(cquery)));
202 }
203
204- auto activation = new ScopeActivation();
205+ auto activation = new ScopeActivation(result, metadata);
206 qDebug() << "perform_action called with action_id" << QString().fromStdString(action_id);
207
208 if (action_id == click::Preview::Actions::UNINSTALL_CLICK) {
209
210=== modified file 'scope/clickapps/apps-scope.h'
211--- scope/clickapps/apps-scope.h 2014-05-27 06:57:52 +0000
212+++ scope/clickapps/apps-scope.h 2014-06-18 17:38:31 +0000
213@@ -49,14 +49,14 @@
214 Scope();
215 ~Scope();
216
217- virtual int start(std::string const&, scopes::RegistryProxy const&) override;
218+ virtual void start(std::string const&, scopes::RegistryProxy const&) override;
219
220 virtual void run() override;
221 virtual void stop() override;
222
223- virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const&) override;
224+ virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const& metadata) override;
225 unity::scopes::PreviewQueryBase::UPtr preview(const unity::scopes::Result&,
226- const unity::scopes::ActionMetadata&) override;
227+ const unity::scopes::ActionMetadata& hints) override;
228
229 virtual unity::scopes::ActivationQueryBase::UPtr perform_action(unity::scopes::Result const& result, unity::scopes::ActionMetadata const& metadata, std::string const& widget_id, std::string const& action_id) override;
230
231
232=== modified file 'scope/clickstore/store-query.cpp'
233--- scope/clickstore/store-query.cpp 2014-06-13 23:18:41 +0000
234+++ scope/clickstore/store-query.cpp 2014-06-18 17:38:31 +0000
235@@ -93,20 +93,19 @@
236
237 struct click::Query::Private
238 {
239- Private(const unity::scopes::CannedQuery& query, click::Index& index, const scopes::SearchMetadata& metadata)
240- : query(query),
241- index(index),
242+ Private(click::Index& index, const scopes::SearchMetadata& metadata)
243+ : index(index),
244 meta(metadata)
245 {
246 }
247- unity::scopes::CannedQuery query;
248 click::Index& index;
249 scopes::SearchMetadata meta;
250 click::web::Cancellable search_operation;
251 };
252
253 click::Query::Query(unity::scopes::CannedQuery const& query, click::Index& index, scopes::SearchMetadata const& metadata)
254- : impl(new Private(query, index, metadata))
255+ : unity::scopes::SearchQueryBase(query, metadata),
256+ impl(new Private(index, metadata))
257 {
258 }
259
260@@ -117,7 +116,7 @@
261
262 void click::Query::cancelled()
263 {
264- qDebug() << "cancelling search of" << QString::fromStdString(impl->query.query_string());
265+ qDebug() << "cancelling search of" << QString::fromStdString(query().query_string());
266 impl->search_operation.cancel();
267 }
268
269@@ -198,8 +197,8 @@
270 this->finished(searchReply);
271 };
272
273- qDebug() << "starting search of" << QString::fromStdString(impl->query.query_string());
274- impl->search_operation = impl->index.search(impl->query.query_string(), search_cb);
275+ qDebug() << "starting search of" << QString::fromStdString(query().query_string());
276+ impl->search_operation = impl->index.search(query().query_string(), search_cb);
277 });
278 }
279
280@@ -222,9 +221,9 @@
281
282 void click::Query::run(scopes::SearchReplyProxy const& searchReply)
283 {
284- auto query = impl->query.query_string();
285+ auto q = query().query_string();
286 std::string categoryTemplate = CATEGORY_APPS_SEARCH;
287- if (query.empty()) {
288+ if (q.empty()) {
289 categoryTemplate = CATEGORY_APPS_DISPLAY;
290 }
291
292
293=== modified file 'scope/clickstore/store-scope.cpp'
294--- scope/clickstore/store-scope.cpp 2014-06-12 13:59:29 +0000
295+++ scope/clickstore/store-scope.cpp 2014-06-18 17:38:31 +0000
296@@ -54,13 +54,11 @@
297 {
298 }
299
300-int click::Scope::start(std::string const&, scopes::RegistryProxy const&)
301+void click::Scope::start(std::string const&, scopes::RegistryProxy const&)
302 {
303 setlocale(LC_ALL, "");
304 bindtextdomain(GETTEXT_PACKAGE, GETTEXT_LOCALEDIR);
305 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
306-
307- return VERSION;
308 }
309
310 void click::Scope::run()
311@@ -91,9 +89,9 @@
312 return scopes::PreviewQueryBase::UPtr{new click::Preview(result, metadata, client, nam)};
313 }
314
315-unity::scopes::ActivationQueryBase::UPtr click::Scope::perform_action(unity::scopes::Result const& /* result */, unity::scopes::ActionMetadata const& metadata, std::string const& /* widget_id */, std::string const& action_id)
316+unity::scopes::ActivationQueryBase::UPtr click::Scope::perform_action(unity::scopes::Result const& result, unity::scopes::ActionMetadata const& metadata, std::string const& /* widget_id */, std::string const& action_id)
317 {
318- auto activation = new ScopeActivation();
319+ auto activation = new ScopeActivation(result, metadata);
320 qDebug() << "perform_action called with action_id" << QString().fromStdString(action_id);
321
322 // note: OPEN_CLICK and OPEN_ACCOUNTS actions are handled directly by the Dash
323
324=== modified file 'scope/clickstore/store-scope.h'
325--- scope/clickstore/store-scope.h 2014-05-27 06:57:52 +0000
326+++ scope/clickstore/store-scope.h 2014-06-18 17:38:31 +0000
327@@ -49,12 +49,12 @@
328 Scope();
329 ~Scope();
330
331- virtual int start(std::string const&, scopes::RegistryProxy const&) override;
332+ virtual void start(std::string const&, scopes::RegistryProxy const&) override;
333
334 virtual void run() override;
335 virtual void stop() override;
336
337- virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const&) override;
338+ virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const& metadata) override;
339 unity::scopes::PreviewQueryBase::UPtr preview(const unity::scopes::Result&,
340 const unity::scopes::ActionMetadata&) override;
341

Subscribers

People subscribed via source and target branches

to all changes: