Merge lp:~stolowski/unity-scope-click/headerless-department-category into lp:unity-scope-click/devel

Proposed by Paweł Stołowski
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 354
Merged at revision: 355
Proposed branch: lp:~stolowski/unity-scope-click/headerless-department-category
Merge into: lp:unity-scope-click/devel
Diff against target: 74 lines (+11/-7)
3 files modified
scope/clickapps/apps-query.cpp (+6/-3)
scope/clickapps/apps-query.h (+2/-1)
scope/tests/test_apps_query.cpp (+3/-3)
To merge this branch: bzr merge lp:~stolowski/unity-scope-click/headerless-department-category
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
dobey (community) Approve
Review via email: mp+227763@code.launchpad.net

Commit message

Only show apps category title when in the root of departments hierarchy. Updated the title to say "Apps" instead of "My apps".

Description of the change

Only show apps category title when in the root of departments hierarchy. Updated the title to say "Apps" instead of "My apps".

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

I would have preferred to do the rename of the category in another branch, but otherwise looks ok to me.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scope/clickapps/apps-query.cpp'
2--- scope/clickapps/apps-query.cpp 2014-07-18 10:09:44 +0000
3+++ scope/clickapps/apps-query.cpp 2014-07-22 15:00:21 +0000
4@@ -150,10 +150,11 @@
5
6 void click::apps::ResultPusher::push_local_results(
7 const std::vector<click::Application> &apps,
8- const std::string &categoryTemplate)
9+ const std::string &categoryTemplate,
10+ bool show_title)
11 {
12 const scopes::CategoryRenderer rdr(categoryTemplate);
13- auto cat = replyProxy->register_category("local", _("My apps"), "", rdr);
14+ auto cat = replyProxy->register_category("local", show_title ? _("Apps") : "", "", rdr);
15
16 for(const auto & a: apps)
17 {
18@@ -375,9 +376,11 @@
19 pusher.push_top_results(localResults, categoryTemplate);
20 }
21
22+ const bool show_cat_title = current_dept.empty();
23 pusher.push_local_results(
24 localResults,
25- categoryTemplate);
26+ categoryTemplate,
27+ show_cat_title);
28
29 add_fake_store_app(searchReply);
30 }
31
32=== modified file 'scope/clickapps/apps-query.h'
33--- scope/clickapps/apps-query.h 2014-07-16 11:53:51 +0000
34+++ scope/clickapps/apps-query.h 2014-07-22 15:00:21 +0000
35@@ -95,7 +95,8 @@
36 virtual ~ResultPusher() = default;
37
38 virtual void push_local_results(const std::vector<click::Application> &apps,
39- const std::string& categoryTemplate);
40+ const std::string& categoryTemplate,
41+ bool show_title);
42
43 virtual void push_top_results(
44 const std::vector<click::Application>& apps,
45
46=== modified file 'scope/tests/test_apps_query.cpp'
47--- scope/tests/test_apps_query.cpp 2014-07-22 09:41:27 +0000
48+++ scope/tests/test_apps_query.cpp 2014-07-22 15:00:21 +0000
49@@ -108,7 +108,7 @@
50 EXPECT_CALL(*mockreply, push(Matcher<unity::scopes::CategorisedResult const&>(HasApplicationTitle(std::string("App1")))));
51 EXPECT_CALL(*mockreply, push(Matcher<unity::scopes::CategorisedResult const&>(HasApplicationTitle(std::string("App3")))));
52 pusher.push_top_results(apps, categoryTemplate);
53- pusher.push_local_results(apps, categoryTemplate);
54+ pusher.push_local_results(apps, categoryTemplate, true);
55 }
56
57 MATCHER_P(ResultUriMatchesCannedQuery, q, "") {
58@@ -218,7 +218,7 @@
59
60 EXPECT_CALL(*clickif, find_installed_apps(_, _, _)).WillOnce(Return(installed_apps));
61 EXPECT_CALL(mock_reply, register_category("predefined", _, _, _)).WillOnce(Return(ptrCat));
62- EXPECT_CALL(mock_reply, register_category("local", _, _, _)).WillOnce(Return(ptrCat));
63+ EXPECT_CALL(mock_reply, register_category("local", StrNe(""), _, _)).WillOnce(Return(ptrCat));
64 EXPECT_CALL(mock_reply, register_category("store", _, _, _)).WillOnce(Return(ptrCat));
65 EXPECT_CALL(mock_reply, register_departments(MatchesDepartments(expected_departments)));
66
67@@ -255,7 +255,7 @@
68 std::list<std::string> expected_departments({"", "games"});
69
70 EXPECT_CALL(*clickif, find_installed_apps(_, _, _)).WillOnce(Return(installed_apps));
71- EXPECT_CALL(mock_reply, register_category("local", _, _, _)).WillOnce(Return(ptrCat));
72+ EXPECT_CALL(mock_reply, register_category("local", StrEq(""), _, _)).WillOnce(Return(ptrCat));
73 EXPECT_CALL(mock_reply, register_category("store", _, _, _)).WillOnce(Return(ptrCat));
74 EXPECT_CALL(mock_reply, register_departments(MatchesDepartments(expected_departments)));
75

Subscribers

People subscribed via source and target branches

to all changes: