Merge lp:~alecu/unity-scope-click/publisher-field into lp:unity-scope-click

Proposed by Alejandro J. Cura
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 66
Merged at revision: 68
Proposed branch: lp:~alecu/unity-scope-click/publisher-field
Merge into: lp:unity-scope-click
Diff against target: 57 lines (+9/-0)
2 files modified
src/click-scope.vala (+2/-0)
src/click-webservice.vala (+7/-0)
To merge this branch: bzr merge lp:~alecu/unity-scope-click/publisher-field
Reviewer Review Type Date Requested Status
dobey (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+188903@code.launchpad.net

Commit message

Pass the publisher field if available to the app preview

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 'src/click-scope.vala'
2--- src/click-scope.vala 2013-10-02 17:44:29 +0000
3+++ src/click-scope.vala 2013-10-02 19:17:26 +0000
4@@ -61,6 +61,7 @@
5 class ClickScope: Unity.AbstractScope
6 {
7 const string HINT_SCREENSHOTS = "more-screenshots";
8+ const string HINT_PUBLISHER = "publisher";
9 const string HINT_KEYWORDS = "keywords";
10 const string HINT_RATING = "rating";
11 const string HINT_RATED = "rated";
12@@ -101,6 +102,7 @@
13 var screenshot = new FileIcon(File.new_for_uri(details.main_screenshot_url));
14 var preview = new Unity.ApplicationPreview (details.title, "subtitle", details.description, icon, screenshot);
15 preview.license = details.license;
16+ preview.add_info(new Unity.InfoHint.with_variant(HINT_PUBLISHER, "Publisher", null, new Variant.string(details.publisher)));
17 preview.add_info(new Unity.InfoHint.with_variant(HINT_SCREENSHOTS, LABEL_SCREENSHOTS, null, new Variant.strv(details.more_screenshot_urls)));
18 preview.add_info(new Unity.InfoHint.with_variant(HINT_KEYWORDS, LABEL_KEYWORDS, null, new Variant.strv(details.keywords)));
19 // TODO: get the proper ratings and reviews from the rnr web service
20
21=== modified file 'src/click-webservice.vala'
22--- src/click-webservice.vala 2013-09-27 19:27:24 +0000
23+++ src/click-webservice.vala 2013-10-02 19:17:26 +0000
24@@ -27,6 +27,7 @@
25 const string JSON_FIELD_DOWNLOAD_URL = "download_url";
26 const string JSON_FIELD_SCREENSHOT_URL = "screenshot_url";
27 const string JSON_FIELD_LICENSE = "license";
28+const string JSON_FIELD_PUBLISHER = "publisher";
29 const string JSON_FIELD_BINARY_FILESIZE = "binary_filesize";
30 const string JSON_FIELD_SCREENSHOT_URLS = "screenshot_urls";
31 const string JSON_FIELD_DESCRIPTION = "description";
32@@ -112,6 +113,7 @@
33 public string terms_of_service { get; construct; }
34 public string package_name { get; construct; }
35 public string license { get; construct; }
36+ public string publisher { get; construct; }
37 public string main_screenshot_url { get; construct; }
38 public string[] more_screenshot_urls { get; construct; }
39 public uint64 binary_filesize { get; construct; }
40@@ -145,6 +147,10 @@
41 var parser = new Json.Parser();
42 parser.load_from_data(json_string, -1);
43 var details = parser.get_root().get_object();
44+ var publisher = "";
45+ if (details.has_member(JSON_FIELD_PUBLISHER)) {
46+ publisher = details.get_string_member(JSON_FIELD_PUBLISHER);
47+ }
48
49 Object(
50 app_id: details.get_string_member(JSON_FIELD_NAME),
51@@ -152,6 +158,7 @@
52 download_url: details.get_string_member(JSON_FIELD_DOWNLOAD_URL),
53 main_screenshot_url: details.get_string_member(JSON_FIELD_SCREENSHOT_URL),
54 license: details.get_string_member(JSON_FIELD_LICENSE),
55+ publisher: publisher,
56 binary_filesize: details.get_int_member(JSON_FIELD_BINARY_FILESIZE),
57 more_screenshot_urls: parse_string_list (details, JSON_FIELD_SCREENSHOT_URLS),
58

Subscribers

People subscribed via source and target branches