Merge lp:~mhr3/libunity/fix-1231951 into lp:libunity

Proposed by Michal Hruby
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 297
Merged at revision: 297
Proposed branch: lp:~mhr3/libunity/fix-1231951
Merge into: lp:libunity
Diff against target: 133 lines (+26/-1)
7 files modified
configure.ac (+1/-1)
debian/changelog (+6/-0)
debian/libunity9.symbols (+2/-0)
protocol/protocol-scope-discovery.vala (+8/-0)
src/unity-category.vala (+6/-0)
test/data/unity/scopes/masterscope_b.scope (+1/-0)
test/vala/test-scope-discovery.vala (+2/-0)
To merge this branch: bzr merge lp:~mhr3/libunity/fix-1231951
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+188056@code.launchpad.net

Commit message

Add API to set renderer hints.

Description of the change

Add API to set renderer hints.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~mhr3/libunity/fix-1231951 updated
297. By Michal Hruby

Add API for renderer hints

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

LGTM. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2013-09-03 14:26:28 +0000
3+++ configure.ac 2013-09-27 14:41:38 +0000
4@@ -1,5 +1,5 @@
5 # When releasing also remember to update the soname as instructed below
6-AC_INIT(libunity, 7.1.1)
7+AC_INIT(libunity, 7.1.2)
8
9 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
10 AM_CONFIG_HEADER(config.h)
11
12=== modified file 'debian/changelog'
13--- debian/changelog 2013-09-27 03:10:38 +0000
14+++ debian/changelog 2013-09-27 14:41:38 +0000
15@@ -1,3 +1,9 @@
16+libunity (7.1.2-0ubuntu1) UNRELEASED; urgency=low
17+
18+ * Add API to specify arbitrary renderer hints for categories
19+
20+ -- Michal Hruby <michal.hruby@canonical.com> Fri, 27 Sep 2013 14:34:53 +0100
21+
22 libunity (7.1.1+13.10.20130927-0ubuntu1) saucy; urgency=low
23
24 [ Michal Hruby ]
25
26=== modified file 'debian/libunity9.symbols'
27--- debian/libunity9.symbols 2013-09-20 11:22:21 +0000
28+++ debian/libunity9.symbols 2013-09-27 14:41:38 +0000
29@@ -176,6 +176,7 @@
30 unity_category_get_id@Base 7.0.0daily13.05.31ubuntu.unity.next
31 unity_category_get_name@Base 4.0.0
32 unity_category_get_renderer@Base 4.0.0
33+ unity_category_get_renderer_hint@Base 0replaceme
34 unity_category_get_type@Base 4.0.0
35 unity_category_new@Base 4.0.0
36 unity_category_renderer_from_string@Base 7.0.4daily13.06.19
37@@ -187,6 +188,7 @@
38 unity_category_set_get_categories@Base 7.0.0daily13.05.31ubuntu.unity.next
39 unity_category_set_get_type@Base 7.0.0daily13.05.31ubuntu.unity.next
40 unity_category_set_new@Base 7.0.0daily13.05.31ubuntu.unity.next
41+ unity_category_set_renderer_hint@Base 0replaceme
42 unity_category_type_get_type@Base 5.94.0
43 unity_check_option_filter_compact_construct@Base 5.2.0
44 unity_check_option_filter_compact_get_type@Base 5.2.0
45
46=== modified file 'protocol/protocol-scope-discovery.vala'
47--- protocol/protocol-scope-discovery.vala 2013-09-06 15:44:11 +0000
48+++ protocol/protocol-scope-discovery.vala 2013-09-27 14:41:38 +0000
49@@ -120,6 +120,7 @@
50 public string? content_type { get; private set; }
51 public string? dedup_field { get; private set; }
52 public string? sort_field { get; private set; }
53+ public string? renderer_hint { get; set; }
54
55 internal static CategoryDefinition create (string id, string name,
56 string icon,
57@@ -487,6 +488,12 @@
58 cat_content_type = file.get_string (group_name, "ContentType");
59 }
60
61+ string? renderer_hint = null;
62+ if (file.has_key (group_name, "RendererHint"))
63+ {
64+ renderer_hint = file.get_string (group_name, "RendererHint");
65+ }
66+
67 var category_definition = CategoryDefinition.create (id, name, icon,
68 renderer,
69 cat_content_type,
70@@ -494,6 +501,7 @@
71 sort_field);
72 if (category_definition != null)
73 {
74+ category_definition.renderer_hint = renderer_hint;
75 categories += category_definition;
76 }
77 }
78
79=== modified file 'src/unity-category.vala'
80--- src/unity-category.vala 2013-08-19 12:00:49 +0000
81+++ src/unity-category.vala 2013-09-27 14:41:38 +0000
82@@ -163,6 +163,7 @@
83 public Icon? icon_hint { get; construct; }
84 public CategoryRenderer default_renderer { get; construct; }
85 public CategoryContentType content_type { get; construct set; }
86+ public string renderer_hint { get; set; }
87
88 public Category (string id,
89 string name,
90@@ -203,6 +204,11 @@
91 hints["content-type"] =
92 new Variant.string (CategoryContentType.to_string (content_type));
93
94+ if (renderer_hint != null)
95+ {
96+ hints["renderer-hint"] = new Variant.string (renderer_hint);
97+ }
98+
99 return hints;
100 }
101 }
102
103=== modified file 'test/data/unity/scopes/masterscope_b.scope'
104--- test/data/unity/scopes/masterscope_b.scope 2013-07-11 10:34:15 +0000
105+++ test/data/unity/scopes/masterscope_b.scope 2013-09-27 14:41:38 +0000
106@@ -28,6 +28,7 @@
107 Icon=/usr/share/unity/category2_icon.svg
108 Renderer=list
109 ContentType=music
110+RendererHint=compact
111 SortField=title
112
113 [Filter genre]
114
115=== modified file 'test/vala/test-scope-discovery.vala'
116--- test/vala/test-scope-discovery.vala 2013-09-06 10:51:35 +0000
117+++ test/vala/test-scope-discovery.vala 2013-09-27 14:41:38 +0000
118@@ -557,6 +557,7 @@
119 assert (category.sort_field == null);
120 assert (category.renderer == null);
121 assert (category.content_type == null);
122+ assert (category.renderer_hint == null);
123
124 category = categories[1];
125 assert (category.id == "cat2");
126@@ -566,6 +567,7 @@
127 assert (category.sort_field == "title");
128 assert (category.renderer == "list");
129 assert (category.content_type == "music");
130+ assert (category.renderer_hint == "compact");
131
132 var filters = metadata.get_filters ();
133 assert (filters != null);

Subscribers

People subscribed via source and target branches