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
=== modified file 'src/smart-scopes-default-parser.vala'
--- src/smart-scopes-default-parser.vala 2013-08-16 14:56:38 +0000
+++ src/smart-scopes-default-parser.vala 2013-09-11 15:37:08 +0000
@@ -39,16 +39,9 @@
39 if (result_uri.has_prefix("scopes-query"))39 if (result_uri.has_prefix("scopes-query"))
40 result_uri = "x-unity-no-preview-" + result_uri;40 result_uri = "x-unity-no-preview-" + result_uri;
4141
42 string? image_uri = null;42 string? icon_hint = null;
43 if (result_dict.has_member ("icon_hint"))43 if (result_dict.has_member ("icon_hint"))
44 image_uri = result_dict.get_string_member ("icon_hint");44 icon_hint = result_dict.get_string_member ("icon_hint");
45
46 Icon? icon = null;
47 if (image_uri != null && image_uri != "")
48 {
49 var file = File.new_for_uri (image_uri);
50 icon = new FileIcon (file);
51 }
5245
53 Variant? metadata_var = null;46 Variant? metadata_var = null;
54 try47 try
@@ -65,15 +58,17 @@
65 metadata_var = new Variant.array (VariantType.VARDICT.element (), {} );58 metadata_var = new Variant.array (VariantType.VARDICT.element (), {} );
66 }59 }
6760
61 var uri_variant = new Variant.string (result_uri);
62
68 Variant row[9] = {63 Variant row[9] = {
69 result_uri,64 uri_variant,
70 icon != null ? icon.to_string () : "",65 new Variant.string (icon_hint != null ? icon_hint : ""),
71 new Variant.uint32 (0), //global category66 new Variant.uint32 (0), //global category
72 new Variant.uint32 (Unity.ResultType.DEFAULT),67 new Variant.uint32 (Unity.ResultType.DEFAULT),
73 new Variant.string ("text/html"),68 new Variant.string ("text/html"),
74 new Variant.string (result_dict.get_string_member ("title")),69 new Variant.string (result_dict.get_string_member ("title")),
75 new Variant.string (result_dict.has_member ("comment") ? result_dict.get_string_member ("comment") : ""),70 new Variant.string (result_dict.has_member ("comment") ? result_dict.get_string_member ("comment") : ""),
76 new Variant.string (result_uri),71 uri_variant,
77 metadata_var72 metadata_var
78 };73 };
7974

Subscribers

People subscribed via source and target branches

to all changes: