Merge lp:~mhr3/unity-scope-home/fix-1223940 into lp:unity-scope-home

Proposed by Michal Hruby
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 162
Merged at revision: 162
Proposed branch: lp:~mhr3/unity-scope-home/fix-1223940
Merge into: lp:unity-scope-home
Diff against target: 42 lines (+7/-12)
1 file modified
src/smart-scopes-default-parser.vala (+7/-12)
To merge this branch: bzr merge lp:~mhr3/unity-scope-home/fix-1223940
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Paweł Stołowski (community) Approve
Review via email: mp+185088@code.launchpad.net

Commit message

Support non-FileIcons coming from the smart scopes server.

Description of the change

Support non-FileIcons coming from the smart scopes server.

To post a comment you must log in.
Revision history for this message
Paweł Stołowski (stolowski) wrote :

LGTM, +1.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/smart-scopes-default-parser.vala'
2--- src/smart-scopes-default-parser.vala 2013-08-16 14:56:38 +0000
3+++ src/smart-scopes-default-parser.vala 2013-09-11 15:37:08 +0000
4@@ -39,16 +39,9 @@
5 if (result_uri.has_prefix("scopes-query"))
6 result_uri = "x-unity-no-preview-" + result_uri;
7
8- string? image_uri = null;
9+ string? icon_hint = null;
10 if (result_dict.has_member ("icon_hint"))
11- image_uri = result_dict.get_string_member ("icon_hint");
12-
13- Icon? icon = null;
14- if (image_uri != null && image_uri != "")
15- {
16- var file = File.new_for_uri (image_uri);
17- icon = new FileIcon (file);
18- }
19+ icon_hint = result_dict.get_string_member ("icon_hint");
20
21 Variant? metadata_var = null;
22 try
23@@ -65,15 +58,17 @@
24 metadata_var = new Variant.array (VariantType.VARDICT.element (), {} );
25 }
26
27+ var uri_variant = new Variant.string (result_uri);
28+
29 Variant row[9] = {
30- result_uri,
31- icon != null ? icon.to_string () : "",
32+ uri_variant,
33+ new Variant.string (icon_hint != null ? icon_hint : ""),
34 new Variant.uint32 (0), //global category
35 new Variant.uint32 (Unity.ResultType.DEFAULT),
36 new Variant.string ("text/html"),
37 new Variant.string (result_dict.get_string_member ("title")),
38 new Variant.string (result_dict.has_member ("comment") ? result_dict.get_string_member ("comment") : ""),
39- new Variant.string (result_uri),
40+ uri_variant,
41 metadata_var
42 };
43

Subscribers

People subscribed via source and target branches

to all changes: