Merge lp:~gerboland/qtmir/fix-desktop_file_hint into lp:qtmir

Proposed by Gerry Boland
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 350
Merged at revision: 360
Proposed branch: lp:~gerboland/qtmir/fix-desktop_file_hint
Merge into: lp:qtmir
Diff against target: 21 lines (+2/-2)
1 file modified
src/modules/Unity/Application/application_manager.cpp (+2/-2)
To merge this branch: bzr merge lp:~gerboland/qtmir/fix-desktop_file_hint
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+267504@code.launchpad.net

Commit message

authorizeSession incorrectly edits desktopFilePath supplied by desktop_file_hint

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Code looks ok and I didn't spot any regressions when trying it out on a device.

The following happens *with or without* this patch. Doesn't know if it's meant to fix that or not:

This works:
qmlscene football.qml --desktop_file_hint=/usr/share/applications/dialer-app.desktop

This fails (http://paste.ubuntu.com/12048029/):
qmlscene football.qml --desktop_file_hint=/usr/share/click/preinstalled/com.ubuntu.gallery/2.9.1.1209/share/applications/gallery-app.desktop

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

Sure you had this patch installed? For the same desktop file, I do get an error, but it looks like this:

qtmir.applications: Desktop file for appId: "gallery-app" at: "/usr/share/click/preinstalled/com.ubuntu.gallery/2.9.1.1209/share/applications/gallery-app.desktop" is not valid - check its syntax, and that the binary specified by the Exec line is installed!

which is technically true, as the Exec line is
Exec=./gallery-app %u
which is relative, which gdb not happy about. That's something else, which I'm not sure is worth fixing

Revision history for this message
Gerry Boland (gerboland) wrote :

s/gdb/gdk/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/application_manager.cpp'
2--- src/modules/Unity/Application/application_manager.cpp 2015-05-21 18:38:27 +0000
3+++ src/modules/Unity/Application/application_manager.cpp 2015-08-10 12:04:21 +0000
4@@ -736,7 +736,7 @@
5 return;
6 }
7
8- QString desktopFileName = info->getParameter("--desktop_file_hint=");
9+ const QString desktopFileName = info->getParameter("--desktop_file_hint=");
10
11 if (desktopFileName.isNull()) {
12 qCritical() << "ApplicationManager REJECTED connection from app with pid" << pid
13@@ -747,7 +747,7 @@
14 qCDebug(QTMIR_APPLICATIONS) << "Process supplied desktop_file_hint, loading:" << desktopFileName;
15
16 // Guess appId from the desktop file hint
17- QString appId = toShortAppIdIfPossible(desktopFileName.remove(QRegExp(".desktop$")).split('/').last());
18+ const QString appId = toShortAppIdIfPossible(desktopFileName.split('/').last().remove(QRegExp(".desktop$")));
19
20 // FIXME: right now we support --desktop_file_hint=appId for historical reasons. So let's try that in
21 // case we didn't get an existing .desktop file path

Subscribers

People subscribed via source and target branches