Merge lp:~stolowski/unity-scope-click/topapps-use-pkg-and-appname into lp:unity-scope-click/devel

Proposed by Paweł Stołowski
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 335
Merged at revision: 339
Proposed branch: lp:~stolowski/unity-scope-click/topapps-use-pkg-and-appname
Merge into: lp:unity-scope-click/devel
Diff against target: 68 lines (+26/-9)
3 files modified
libclickscope/click/configuration.h (+4/-4)
scope/clickapps/apps-query.cpp (+21/-4)
scope/tests/test_apps_query.cpp (+1/-1)
To merge this branch: bzr merge lp:~stolowski/unity-scope-click/topapps-use-pkg-and-appname
Reviewer Review Type Date Requested Status
dobey (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+226873@code.launchpad.net

Commit message

Expect package_appid name format in dconf key for core apps.

Description of the change

Expect package_appid name format in dconf key for core apps. For now only the 'package'part is used, but this will prepare us for multiple apps per click package in the future.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libclickscope/click/configuration.h'
2--- libclickscope/click/configuration.h 2014-07-07 12:18:40 +0000
3+++ libclickscope/click/configuration.h 2014-07-15 15:50:36 +0000
4@@ -67,10 +67,10 @@
5 static std::vector<std::string> default_apps {
6 "dialer-app",
7 "messaging-app",
8- "com.ubuntu.calculator",
9- "com.ubuntu.clock",
10- "com.ubuntu.camera",
11- "com.ubuntu.calendar"
12+ "com.ubuntu.calculator_calculator",
13+ "com.ubuntu.clock_clock",
14+ "com.ubuntu.camera_camera",
15+ "com.ubuntu.calendar_calendar"
16 };
17 return default_apps;
18 }
19
20=== modified file 'scope/clickapps/apps-query.cpp'
21--- scope/clickapps/apps-query.cpp 2014-07-14 12:44:48 +0000
22+++ scope/clickapps/apps-query.cpp 2014-07-15 15:50:36 +0000
23@@ -87,11 +87,28 @@
24
25 }
26
27-click::apps::ResultPusher::ResultPusher(const scopes::SearchReplyProxy &replyProxy, const std::vector<std::string>& core_apps)
28- : replyProxy(replyProxy),
29- core_apps(core_apps),
30- top_apps_lookup(core_apps.begin(), core_apps.end())
31+click::apps::ResultPusher::ResultPusher(const scopes::SearchReplyProxy &replyProxy, const std::vector<std::string>& apps)
32+ : replyProxy(replyProxy)
33 {
34+ for (auto const& app: apps)
35+ {
36+ //
37+ // click entries in the dconf key are expected to be in the format of
38+ // "foo.bar.package_appname"; split on underscore and just use the first part
39+ // for now (second part should be honored when we support multiple apps per package).
40+ auto i = app.find("_");
41+ if (i != std::string::npos)
42+ {
43+ const std::string pkg = app.substr(0, i);
44+ core_apps.push_back(pkg);
45+ top_apps_lookup.insert(pkg);
46+ }
47+ else
48+ {
49+ core_apps.push_back(app);
50+ top_apps_lookup.insert(app);
51+ }
52+ }
53 }
54
55 void click::apps::ResultPusher::push_result(scopes::Category::SCPtr& cat, const click::Application& a)
56
57=== modified file 'scope/tests/test_apps_query.cpp'
58--- scope/tests/test_apps_query.cpp 2014-07-14 12:44:48 +0000
59+++ scope/tests/test_apps_query.cpp 2014-07-15 15:50:36 +0000
60@@ -68,7 +68,7 @@
61 {"", "App4", 0.0f, "icon", "application:///app4.desktop", "", "sshot"} // a non-click app
62 };
63
64- click::apps::ResultPusher pusher(reply, {"app2", "app4"});
65+ click::apps::ResultPusher pusher(reply, {"app2_fooappname", "app4"});
66 auto mockreply = (scopes::testing::MockSearchReply*)reply.get();
67
68 scopes::CategoryRenderer renderer("{}");

Subscribers

People subscribed via source and target branches

to all changes: