Merge lp:~dobey/unity-scope-click/merge-trunk into lp:unity-scope-click/devel
- merge-trunk
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Alejandro J. Cura |
Approved revision: | no longer in the source branch. |
Merged at revision: | 296 |
Proposed branch: | lp:~dobey/unity-scope-click/merge-trunk |
Merge into: | lp:unity-scope-click/devel |
Diff against target: |
382 lines (+78/-50) 12 files modified
CMakeLists.txt (+1/-1) debian/changelog (+28/-0) 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 (+4/-8) scope/clickstore/store-scope.h (+2/-2) |
To merge this branch: | bzr merge lp:~dobey/unity-scope-click/merge-trunk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Alejandro J. Cura (community) | Approve | ||
Review via email: mp+223791@code.launchpad.net |
Commit message
Merge changes from trunk for new scopes API 0.5.0.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:297
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 296. By Paweł Stołowski
-
Merge changes from trunk for new scopes API 0.5.0.
Approved by PS Jenkins bot, Alejandro J. Cura.
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-05-27 13:15:52 +0000 |
3 | +++ CMakeLists.txt 2014-06-19 17:06:02 +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/changelog' |
15 | --- debian/changelog 2014-06-11 16:50:57 +0000 |
16 | +++ debian/changelog 2014-06-19 17:06:02 +0000 |
17 | @@ -1,3 +1,31 @@ |
18 | +unity-scope-click (0.1+14.10.20140618.1-0ubuntu1) utopic; urgency=low |
19 | + |
20 | + [ Pawel Stolowski ] |
21 | + * Updated for new scopes API 0.5.0 |
22 | + |
23 | + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 18 Jun 2014 17:49:55 +0000 |
24 | + |
25 | +unity-scope-click (0.1+14.10.20140618-0ubuntu1) utopic; urgency=medium |
26 | + |
27 | + [ Rodney Dawes ] |
28 | + * New upstream release. |
29 | + - Translation updates. |
30 | + - Split scope into two scopes, Apps and Store. |
31 | + - Move core functionality into a static library shared by both scopes. |
32 | + - Sort installed apps alphabetically, based on current locale. |
33 | + - Add build dependency on libboost-locale-dev for locale based sorting. |
34 | + - Only build on amd64 armhf and i386, as ubuntu-sdk-libs. |
35 | + - Create the log handler ourselves. (LP: #1322501) |
36 | + - Convert autopilot tests to python3. |
37 | + - Remove the dependency on ubuntu-purchase-service. (LP: #1323334) |
38 | + - Remove extra dependencies and test restrictions from autopkgtests. |
39 | + - Load keywords from .desktop files and search them. (LP: #1316237) |
40 | + - Label installed packages as such in store scope. |
41 | + - Allow launching installed scopes from store scope preview. |
42 | + - Don't filter out installed packages from store scope. (LP: #1325224) |
43 | + |
44 | + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 18 Jun 2014 06:33:38 +0000 |
45 | + |
46 | unity-scope-click (0.1+14.10.20140611-0ubuntu1) utopic; urgency=low |
47 | |
48 | [ Rodney Dawes ] |
49 | |
50 | === modified file 'debian/control' |
51 | --- debian/control 2014-06-13 15:21:16 +0000 |
52 | +++ debian/control 2014-06-19 17:06:02 +0000 |
53 | @@ -13,7 +13,7 @@ |
54 | libubuntu-download-manager-common-dev (>= 0.3+14.10.20140430-0ubuntu1), |
55 | libubuntuoneauth-2.0-dev, |
56 | libunity-api-dev (>= 7.80.7), |
57 | - libunity-scopes-dev (>= 0.4.0), |
58 | + libunity-scopes-dev (>= 0.5.0), |
59 | pkg-config, |
60 | python3-all, |
61 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
62 | |
63 | === modified file 'libclickscope/click/preview.cpp' |
64 | --- libclickscope/click/preview.cpp 2014-06-17 21:05:05 +0000 |
65 | +++ libclickscope/click/preview.cpp 2014-06-19 17:06:02 +0000 |
66 | @@ -57,6 +57,7 @@ |
67 | const unity::scopes::ActionMetadata& metadata, |
68 | const QSharedPointer<click::web::Client>& client, |
69 | const QSharedPointer<click::network::AccessManager>& nam) |
70 | + : PreviewQueryBase(result, metadata) |
71 | { |
72 | strategy.reset(choose_strategy(result, metadata, client, nam)); |
73 | } |
74 | |
75 | === modified file 'libclickscope/click/scope_activation.cpp' |
76 | --- libclickscope/click/scope_activation.cpp 2014-05-28 07:42:24 +0000 |
77 | +++ libclickscope/click/scope_activation.cpp 2014-06-19 17:06:02 +0000 |
78 | @@ -33,6 +33,11 @@ |
79 | #include <click/qtbridge.h> |
80 | #include <unity/scopes/ActivationResponse.h> |
81 | |
82 | +click::ScopeActivation::ScopeActivation(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata) |
83 | + : unity::scopes::ActivationQueryBase(result, metadata) |
84 | +{ |
85 | +} |
86 | + |
87 | unity::scopes::ActivationResponse click::ScopeActivation::activate() |
88 | { |
89 | auto response = unity::scopes::ActivationResponse(status_); |
90 | @@ -50,18 +55,19 @@ |
91 | hints_[key] = value; |
92 | } |
93 | |
94 | -click::PerformUninstallAction::PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActivationResponse& response) |
95 | - : result(result), |
96 | +click::PerformUninstallAction::PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata, const unity::scopes::ActivationResponse& response) |
97 | + : unity::scopes::ActivationQueryBase(result, metadata), |
98 | response(response) |
99 | { |
100 | } |
101 | |
102 | unity::scopes::ActivationResponse click::PerformUninstallAction::activate() |
103 | { |
104 | + auto const res = result(); |
105 | click::Package package; |
106 | - package.title = result.title(); |
107 | - package.name = result["name"].get_string(); |
108 | - package.version = result["version"].get_string(); |
109 | + package.title = res.title(); |
110 | + package.name = res["name"].get_string(); |
111 | + package.version = res["version"].get_string(); |
112 | qt::core::world::enter_with_task([this, package] () |
113 | { |
114 | click::PackageManager manager; |
115 | |
116 | === modified file 'libclickscope/click/scope_activation.h' |
117 | --- libclickscope/click/scope_activation.h 2014-05-28 07:42:24 +0000 |
118 | +++ libclickscope/click/scope_activation.h 2014-06-19 17:06:02 +0000 |
119 | @@ -40,11 +40,10 @@ |
120 | class PerformUninstallAction: public unity::scopes::ActivationQueryBase |
121 | { |
122 | public: |
123 | - PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActivationResponse& response); |
124 | + PerformUninstallAction(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata, const unity::scopes::ActivationResponse& response); |
125 | unity::scopes::ActivationResponse activate() override; |
126 | |
127 | private: |
128 | - unity::scopes::Result result; |
129 | unity::scopes::ActivationResponse response; |
130 | }; |
131 | |
132 | @@ -53,6 +52,7 @@ |
133 | unity::scopes::ActivationResponse activate() override; |
134 | |
135 | public: |
136 | + ScopeActivation(const unity::scopes::Result& result, const unity::scopes::ActionMetadata& metadata); |
137 | void setStatus(unity::scopes::ActivationResponse::Status status); |
138 | void setHint(std::string key, unity::scopes::Variant value); |
139 | |
140 | |
141 | === removed file 'libclickscope/tests/test_data.cpp' |
142 | === modified file 'scope/clickapps/apps-query.cpp' |
143 | --- scope/clickapps/apps-query.cpp 2014-06-10 21:09:52 +0000 |
144 | +++ scope/clickapps/apps-query.cpp 2014-06-19 17:06:02 +0000 |
145 | @@ -128,25 +128,24 @@ |
146 | |
147 | struct click::Query::Private |
148 | { |
149 | - Private(const unity::scopes::CannedQuery& query, click::Index& index, const scopes::SearchMetadata& metadata) |
150 | - : query(query), |
151 | - index(index), |
152 | + Private(click::Index& index, const scopes::SearchMetadata& metadata) |
153 | + : index(index), |
154 | meta(metadata) |
155 | { |
156 | } |
157 | - unity::scopes::CannedQuery query; |
158 | click::Index& index; |
159 | scopes::SearchMetadata meta; |
160 | }; |
161 | |
162 | click::Query::Query(unity::scopes::CannedQuery const& query, click::Index& index, scopes::SearchMetadata const& metadata) |
163 | - : impl(new Private(query, index, metadata)) |
164 | + : unity::scopes::SearchQueryBase(query, metadata), |
165 | + impl(new Private(index, metadata)) |
166 | { |
167 | } |
168 | |
169 | void click::Query::cancelled() |
170 | { |
171 | - qDebug() << "cancelling search of" << QString::fromStdString(impl->query.query_string()); |
172 | + qDebug() << "cancelling search of" << QString::fromStdString(query().query_string()); |
173 | } |
174 | |
175 | click::Query::~Query() |
176 | @@ -171,10 +170,10 @@ |
177 | static const std::string title = _("Get more apps in Ubuntu store"); |
178 | auto name = title; |
179 | |
180 | - std::string query = impl->query.query_string(); |
181 | - std::transform(query.begin(), query.end(), query.begin(), ::tolower); |
182 | + std::string querystr = query().query_string(); |
183 | + std::transform(querystr.begin(), querystr.end(), querystr.begin(), ::tolower); |
184 | std::transform(name.begin(), name.end(), name.begin(), ::tolower); |
185 | - if (query.empty() || name.find(query) != std::string::npos) |
186 | + if (querystr.empty() || name.find(querystr) != std::string::npos) |
187 | { |
188 | scopes::CategoryRenderer rdr(CATEGORY_STORE); |
189 | auto cat = searchReply->register_category("store", "", "", rdr); |
190 | @@ -196,13 +195,13 @@ |
191 | |
192 | void click::Query::run(scopes::SearchReplyProxy const& searchReply) |
193 | { |
194 | - auto query = impl->query.query_string(); |
195 | + auto querystr = query().query_string(); |
196 | std::string categoryTemplate = CATEGORY_APPS_SEARCH; |
197 | - if (query.empty()) { |
198 | + if (querystr.empty()) { |
199 | categoryTemplate = CATEGORY_APPS_DISPLAY; |
200 | } |
201 | auto localResults = clickInterfaceInstance().find_installed_apps( |
202 | - query); |
203 | + querystr); |
204 | |
205 | push_local_results( |
206 | searchReply, |
207 | |
208 | === modified file 'scope/clickapps/apps-scope.cpp' |
209 | --- scope/clickapps/apps-scope.cpp 2014-06-12 14:26:26 +0000 |
210 | +++ scope/clickapps/apps-scope.cpp 2014-06-19 17:06:02 +0000 |
211 | @@ -54,13 +54,11 @@ |
212 | { |
213 | } |
214 | |
215 | -int click::Scope::start(std::string const&, scopes::RegistryProxy const&) |
216 | +void click::Scope::start(std::string const&, scopes::RegistryProxy const&) |
217 | { |
218 | setlocale(LC_ALL, ""); |
219 | bindtextdomain(GETTEXT_PACKAGE, GETTEXT_LOCALEDIR); |
220 | bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); |
221 | - |
222 | - return VERSION; |
223 | } |
224 | |
225 | void click::Scope::run() |
226 | @@ -91,14 +89,15 @@ |
227 | } |
228 | |
229 | |
230 | -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) |
231 | +unity::scopes::ActivationQueryBase::UPtr click::Scope::perform_action(unity::scopes::Result const& result, unity::scopes::ActionMetadata const& metadata, |
232 | + std::string const& /* widget_id */, std::string const& action_id) |
233 | { |
234 | if (action_id == click::Preview::Actions::CONFIRM_UNINSTALL) { |
235 | const unity::scopes::CannedQuery cquery("clickscope"); |
236 | - return scopes::ActivationQueryBase::UPtr(new PerformUninstallAction(result, unity::scopes::ActivationResponse(cquery))); |
237 | + return scopes::ActivationQueryBase::UPtr(new PerformUninstallAction(result, metadata, unity::scopes::ActivationResponse(cquery))); |
238 | } |
239 | |
240 | - auto activation = new ScopeActivation(); |
241 | + auto activation = new ScopeActivation(result, metadata); |
242 | qDebug() << "perform_action called with action_id" << QString().fromStdString(action_id); |
243 | |
244 | if (action_id == click::Preview::Actions::UNINSTALL_CLICK) { |
245 | |
246 | === modified file 'scope/clickapps/apps-scope.h' |
247 | --- scope/clickapps/apps-scope.h 2014-05-27 06:57:52 +0000 |
248 | +++ scope/clickapps/apps-scope.h 2014-06-19 17:06:02 +0000 |
249 | @@ -49,14 +49,14 @@ |
250 | Scope(); |
251 | ~Scope(); |
252 | |
253 | - virtual int start(std::string const&, scopes::RegistryProxy const&) override; |
254 | + virtual void start(std::string const&, scopes::RegistryProxy const&) override; |
255 | |
256 | virtual void run() override; |
257 | virtual void stop() override; |
258 | |
259 | - virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const&) override; |
260 | + virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const& metadata) override; |
261 | unity::scopes::PreviewQueryBase::UPtr preview(const unity::scopes::Result&, |
262 | - const unity::scopes::ActionMetadata&) override; |
263 | + const unity::scopes::ActionMetadata& hints) override; |
264 | |
265 | 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; |
266 | |
267 | |
268 | === modified file 'scope/clickstore/store-query.cpp' |
269 | --- scope/clickstore/store-query.cpp 2014-06-13 23:18:41 +0000 |
270 | +++ scope/clickstore/store-query.cpp 2014-06-19 17:06:02 +0000 |
271 | @@ -93,20 +93,19 @@ |
272 | |
273 | struct click::Query::Private |
274 | { |
275 | - Private(const unity::scopes::CannedQuery& query, click::Index& index, const scopes::SearchMetadata& metadata) |
276 | - : query(query), |
277 | - index(index), |
278 | + Private(click::Index& index, const scopes::SearchMetadata& metadata) |
279 | + : index(index), |
280 | meta(metadata) |
281 | { |
282 | } |
283 | - unity::scopes::CannedQuery query; |
284 | click::Index& index; |
285 | scopes::SearchMetadata meta; |
286 | click::web::Cancellable search_operation; |
287 | }; |
288 | |
289 | click::Query::Query(unity::scopes::CannedQuery const& query, click::Index& index, scopes::SearchMetadata const& metadata) |
290 | - : impl(new Private(query, index, metadata)) |
291 | + : unity::scopes::SearchQueryBase(query, metadata), |
292 | + impl(new Private(index, metadata)) |
293 | { |
294 | } |
295 | |
296 | @@ -117,7 +116,7 @@ |
297 | |
298 | void click::Query::cancelled() |
299 | { |
300 | - qDebug() << "cancelling search of" << QString::fromStdString(impl->query.query_string()); |
301 | + qDebug() << "cancelling search of" << QString::fromStdString(query().query_string()); |
302 | impl->search_operation.cancel(); |
303 | } |
304 | |
305 | @@ -198,8 +197,8 @@ |
306 | this->finished(searchReply); |
307 | }; |
308 | |
309 | - qDebug() << "starting search of" << QString::fromStdString(impl->query.query_string()); |
310 | - impl->search_operation = impl->index.search(impl->query.query_string(), search_cb); |
311 | + qDebug() << "starting search of" << QString::fromStdString(query().query_string()); |
312 | + impl->search_operation = impl->index.search(query().query_string(), search_cb); |
313 | }); |
314 | } |
315 | |
316 | @@ -222,9 +221,9 @@ |
317 | |
318 | void click::Query::run(scopes::SearchReplyProxy const& searchReply) |
319 | { |
320 | - auto query = impl->query.query_string(); |
321 | + auto q = query().query_string(); |
322 | std::string categoryTemplate = CATEGORY_APPS_SEARCH; |
323 | - if (query.empty()) { |
324 | + if (q.empty()) { |
325 | categoryTemplate = CATEGORY_APPS_DISPLAY; |
326 | } |
327 | |
328 | |
329 | === modified file 'scope/clickstore/store-scope.cpp' |
330 | --- scope/clickstore/store-scope.cpp 2014-06-17 21:32:44 +0000 |
331 | +++ scope/clickstore/store-scope.cpp 2014-06-19 17:06:02 +0000 |
332 | @@ -54,15 +54,13 @@ |
333 | { |
334 | } |
335 | |
336 | -int click::Scope::start(std::string const&, scopes::RegistryProxy const&) |
337 | +void click::Scope::start(std::string const&, scopes::RegistryProxy const&) |
338 | { |
339 | setlocale(LC_ALL, ""); |
340 | // FIXME: This is wrong, but needed for json-cpp workaround. |
341 | setlocale(LC_MONETARY, "C"); |
342 | bindtextdomain(GETTEXT_PACKAGE, GETTEXT_LOCALEDIR); |
343 | bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); |
344 | - |
345 | - return VERSION; |
346 | } |
347 | |
348 | void click::Scope::run() |
349 | @@ -93,12 +91,10 @@ |
350 | return scopes::PreviewQueryBase::UPtr{new click::Preview(result, metadata, client, nam)}; |
351 | } |
352 | |
353 | -unity::scopes::ActivationQueryBase::UPtr click::Scope::perform_action(unity::scopes::Result const& /* result */, unity::scopes::ActionMetadata const& metadata, |
354 | - std::string const& widget_id, std::string const& _action_id) |
355 | +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) |
356 | { |
357 | - std::string action_id = _action_id; |
358 | - auto activation = new ScopeActivation(); |
359 | - qDebug() << "perform_action called with widget_id" << QString::fromStdString(widget_id) << "and action_id:" << QString::fromStdString(action_id); |
360 | + auto activation = new ScopeActivation(result, metadata); |
361 | + qDebug() << "perform_action called with action_id" << QString().fromStdString(action_id); |
362 | |
363 | // if the purchase is completed, do the install |
364 | if (action_id == "purchaseCompleted") { |
365 | |
366 | === modified file 'scope/clickstore/store-scope.h' |
367 | --- scope/clickstore/store-scope.h 2014-05-27 06:57:52 +0000 |
368 | +++ scope/clickstore/store-scope.h 2014-06-19 17:06:02 +0000 |
369 | @@ -49,12 +49,12 @@ |
370 | Scope(); |
371 | ~Scope(); |
372 | |
373 | - virtual int start(std::string const&, scopes::RegistryProxy const&) override; |
374 | + virtual void start(std::string const&, scopes::RegistryProxy const&) override; |
375 | |
376 | virtual void run() override; |
377 | virtual void stop() override; |
378 | |
379 | - virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const&) override; |
380 | + virtual scopes::SearchQueryBase::UPtr search(scopes::CannedQuery const& q, scopes::SearchMetadata const& metadata) override; |
381 | unity::scopes::PreviewQueryBase::UPtr preview(const unity::scopes::Result&, |
382 | const unity::scopes::ActionMetadata&) override; |
383 |
Looks good, tests pass.