Merge lp:~marcustomlinson/unity-scope-click/fix-scope-dir into lp:unity-scope-click

Proposed by Marcus Tomlinson on 2016-11-08
Status: Merged
Approved by: Marcus Tomlinson on 2016-11-08
Approved revision: 502
Merged at revision: 500
Proposed branch: lp:~marcustomlinson/unity-scope-click/fix-scope-dir
Merge into: lp:unity-scope-click
Diff against target: 23 lines (+10/-1)
1 file modified
scope/clickapps/apps-query.cpp (+10/-1)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scope-click/fix-scope-dir
Reviewer Review Type Date Requested Status
dobey (community) Approve on 2016-11-08
Paweł Stołowski 2016-11-08 Approve on 2016-11-08
Review via email: mp+310269@code.launchpad.net

Commit message

Prepend $SNAP to the store scope icon path

To post a comment you must log in.
Paweł Stołowski (stolowski) wrote :

+1

review: Approve
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scope/clickapps/apps-query.cpp'
2--- scope/clickapps/apps-query.cpp 2016-11-04 13:30:52 +0000
3+++ scope/clickapps/apps-query.cpp 2016-11-08 13:42:56 +0000
4@@ -308,9 +308,18 @@
5
6 const unity::scopes::CannedQuery store_scope(STORE_SCOPE_ID, querystr, querystr.empty() ? query().department_id() : "");
7
8+ auto get_snap_path = []() {
9+ const char* env_snap = getenv("SNAP");
10+ if (env_snap == nullptr) {
11+ return "";
12+ }
13+ return env_snap;
14+ };
15+ static const std::string SNAP_PATH{get_snap_path()};
16+
17 scopes::CategorisedResult res(cat);
18 res.set_title(title);
19- res.set_art(STORE_DATA_DIR "/store-scope-icon.svg");
20+ res.set_art(SNAP_PATH + STORE_DATA_DIR "/store-scope-icon.svg");
21 res.set_uri(store_scope.to_uri());
22 res[click::apps::Query::ResultKeys::NAME] = title;
23 res[click::apps::Query::ResultKeys::DESCRIPTION] = "";

Subscribers

People subscribed via source and target branches