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
=== modified file 'libclickscope/click/configuration.h'
--- libclickscope/click/configuration.h 2014-07-07 12:18:40 +0000
+++ libclickscope/click/configuration.h 2014-07-15 15:50:36 +0000
@@ -67,10 +67,10 @@
67 static std::vector<std::string> default_apps {67 static std::vector<std::string> default_apps {
68 "dialer-app",68 "dialer-app",
69 "messaging-app",69 "messaging-app",
70 "com.ubuntu.calculator",70 "com.ubuntu.calculator_calculator",
71 "com.ubuntu.clock",71 "com.ubuntu.clock_clock",
72 "com.ubuntu.camera",72 "com.ubuntu.camera_camera",
73 "com.ubuntu.calendar"73 "com.ubuntu.calendar_calendar"
74 };74 };
75 return default_apps;75 return default_apps;
76 }76 }
7777
=== modified file 'scope/clickapps/apps-query.cpp'
--- scope/clickapps/apps-query.cpp 2014-07-14 12:44:48 +0000
+++ scope/clickapps/apps-query.cpp 2014-07-15 15:50:36 +0000
@@ -87,11 +87,28 @@
8787
88}88}
8989
90click::apps::ResultPusher::ResultPusher(const scopes::SearchReplyProxy &replyProxy, const std::vector<std::string>& core_apps)90click::apps::ResultPusher::ResultPusher(const scopes::SearchReplyProxy &replyProxy, const std::vector<std::string>& apps)
91 : replyProxy(replyProxy),91 : replyProxy(replyProxy)
92 core_apps(core_apps),
93 top_apps_lookup(core_apps.begin(), core_apps.end())
94{92{
93 for (auto const& app: apps)
94 {
95 //
96 // click entries in the dconf key are expected to be in the format of
97 // "foo.bar.package_appname"; split on underscore and just use the first part
98 // for now (second part should be honored when we support multiple apps per package).
99 auto i = app.find("_");
100 if (i != std::string::npos)
101 {
102 const std::string pkg = app.substr(0, i);
103 core_apps.push_back(pkg);
104 top_apps_lookup.insert(pkg);
105 }
106 else
107 {
108 core_apps.push_back(app);
109 top_apps_lookup.insert(app);
110 }
111 }
95}112}
96113
97void click::apps::ResultPusher::push_result(scopes::Category::SCPtr& cat, const click::Application& a)114void click::apps::ResultPusher::push_result(scopes::Category::SCPtr& cat, const click::Application& a)
98115
=== modified file 'scope/tests/test_apps_query.cpp'
--- scope/tests/test_apps_query.cpp 2014-07-14 12:44:48 +0000
+++ scope/tests/test_apps_query.cpp 2014-07-15 15:50:36 +0000
@@ -68,7 +68,7 @@
68 {"", "App4", 0.0f, "icon", "application:///app4.desktop", "", "sshot"} // a non-click app68 {"", "App4", 0.0f, "icon", "application:///app4.desktop", "", "sshot"} // a non-click app
69 };69 };
7070
71 click::apps::ResultPusher pusher(reply, {"app2", "app4"});71 click::apps::ResultPusher pusher(reply, {"app2_fooappname", "app4"});
72 auto mockreply = (scopes::testing::MockSearchReply*)reply.get();72 auto mockreply = (scopes::testing::MockSearchReply*)reply.get();
7373
74 scopes::CategoryRenderer renderer("{}");74 scopes::CategoryRenderer renderer("{}");

Subscribers

People subscribed via source and target branches

to all changes: