Merge lp:~dobey/unity-scope-click/bad-appid into lp:unity-scope-click

Proposed by dobey
Status: Merged
Approved by: Charles Kerr
Approved revision: 400
Merged at revision: 400
Proposed branch: lp:~dobey/unity-scope-click/bad-appid
Merge into: lp:unity-scope-click
Diff against target: 47 lines (+18/-3)
3 files modified
libclickscope/click/interface.cpp (+7/-2)
libclickscope/tests/applications/user/badd-appid.desktop (+10/-0)
libclickscope/tests/test_interface.cpp (+1/-1)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/bad-appid
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+281553@code.launchpad.net

Commit message

Handle App-ID fields that aren't package_app_version as "unknown."

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libclickscope/click/interface.cpp'
2--- libclickscope/click/interface.cpp 2014-10-17 19:26:35 +0000
3+++ libclickscope/click/interface.cpp 2016-01-04 20:59:25 +0000
4@@ -180,8 +180,13 @@
5 DESKTOP_FILE_GROUP,
6 DESKTOP_FILE_KEY_APP_ID));
7 QStringList id = app_id.split("_", QString::SkipEmptyParts);
8- app.name = id[0].toUtf8().data();
9- app.version = id[2].toUtf8().data();
10+ if (id.length() == 3) {
11+ app.name = id[0].toUtf8().data();
12+ app.version = id[2].toUtf8().data();
13+ } else {
14+ app.name = "unknown";
15+ app.version = "unknown";
16+ }
17 }
18 if (keyFile.has_key(DESKTOP_FILE_GROUP, DESKTOP_FILE_COMMENT)) {
19 app.description = get_translated_string(keyFile,
20
21=== added file 'libclickscope/tests/applications/user/badd-appid.desktop'
22--- libclickscope/tests/applications/user/badd-appid.desktop 1970-01-01 00:00:00 +0000
23+++ libclickscope/tests/applications/user/badd-appid.desktop 2016-01-04 20:59:25 +0000
24@@ -0,0 +1,10 @@
25+[Desktop Entry]
26+Version=1.0
27+Type=Application
28+Terminal=false
29+Exec=processTest
30+Icon=/home/phablet/animatedDemos/football-ball.png
31+Path=/home/phablet/processTest
32+Name=Football
33+X-Ubuntu-Touch=true
34+X-Ubuntu-Application-ID=football
35
36=== modified file 'libclickscope/tests/test_interface.cpp'
37--- libclickscope/tests/test_interface.cpp 2014-10-17 19:26:35 +0000
38+++ libclickscope/tests/test_interface.cpp 2016-01-04 20:59:25 +0000
39@@ -185,7 +185,7 @@
40
41 click::Interface iface(keyFileLocator);
42
43- auto results = iface.find_installed_apps("foo");
44+ auto results = iface.find_installed_apps("xyzzygy");
45
46 EXPECT_TRUE(results.empty());
47 }

Subscribers

People subscribed via source and target branches

to all changes: