Merge lp:~stolowski/unity-scope-home/unescape-uri into lp:unity-scope-home

Proposed by Paweł Stołowski
Status: Merged
Approved by: Michal Hruby
Approved revision: 157
Merged at revision: 156
Proposed branch: lp:~stolowski/unity-scope-home/unescape-uri
Merge into: lp:unity-scope-home
Diff against target: 22 lines (+10/-2)
1 file modified
src/scope.vala (+10/-2)
To merge this branch: bzr merge lp:~stolowski/unity-scope-home/unescape-uri
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+183128@code.launchpad.net

Commit message

Unescape search query that comes with scopes-query:// uri.

Description of the change

Unescape search query that comes with scopes-query:// uri.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
157. By Paweł Stołowski

Also utf-validate the query.

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

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scope.vala'
2--- src/scope.vala 2013-08-27 14:28:33 +0000
3+++ src/scope.vala 2013-08-30 11:41:19 +0000
4@@ -530,8 +530,16 @@
5 if (activation.action_type == Unity.Protocol.ActionType.ACTIVATE_RESULT &&
6 activation.scope_result.uri.has_prefix (SCOPES_QUERY_SCHEMA_PREFIX))
7 {
8-
9- return new ActivationResponse.with_search (activation.scope_result.uri.substring (SCOPES_QUERY_SCHEMA_PREFIX.length), null, null);
10+ var query = activation.scope_result.uri.substring (SCOPES_QUERY_SCHEMA_PREFIX.length);
11+ var escaped_query = GLib.Uri.unescape_string (query);
12+ if (escaped_query == null)
13+ escaped_query = query;
14+ if (!escaped_query.validate ()) {
15+ escaped_query = "error: Invalid UTF8";
16+ warning ("Invalid UTF8 received from the server");
17+ }
18+
19+ return new ActivationResponse.with_search (escaped_query != null ? escaped_query : query, null, null);
20 }
21
22 if (!scope_mgr.remote_content_search || sss_client == null ||

Subscribers

People subscribed via source and target branches

to all changes: