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