Merge lp:~sil2100/unity-scopes-shell/revert_25 into lp:unity-scopes-shell

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 29
Proposed branch: lp:~sil2100/unity-scopes-shell/revert_25
Merge into: lp:unity-scopes-shell
Diff against target: 47 lines (+16/-12)
1 file modified
src/Unity/scope.cpp (+16/-12)
To merge this branch: bzr merge lp:~sil2100/unity-scopes-shell/revert_25
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Unity Team Pending
Review via email: mp+198595@code.launchpad.net

Commit message

Revert rev 25 as it seems to cause a big regression, breaking launching of click applications in unity8

Description of the change

Revert rev 25 as it seems to cause a big regression, breaking launching of click applications in unity8

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/scope.cpp'
2--- src/Unity/scope.cpp 2013-12-04 15:52:41 +0000
3+++ src/Unity/scope.cpp 2013-12-11 16:00:15 +0000
4@@ -32,8 +32,6 @@
5 #include <QDebug>
6 #include <QtGui/QDesktopServices>
7 #include <QQmlEngine>
8-#include <QFileInfo>
9-#include <QDir>
10
11 #include <UnityCore/Variant.h>
12 #include <UnityCore/GLibWrapper.h>
13@@ -289,19 +287,25 @@
14 return;
15 }
16 if (url.scheme() == "application") {
17+ // get the full path to the desktop file
18 QString path(url.path().isEmpty() ? url.authority() : url.path());
19-
20- if (path.startsWith('/')) {
21- Q_FOREACH(const QString &dir, QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation)) {
22- if (path.startsWith(dir)) {
23- path.remove(dir);
24- path.replace('/', '-');
25- break;
26- }
27+ if (path.startsWith("/")) {
28+ Q_EMIT activateApplication(path);
29+ } else {
30+ // TODO: use the new desktop file finder/parser when it's ready
31+ gchar* full_path = nullptr;
32+ GKeyFile* key_file = g_key_file_new();
33+ QString apps_path = "applications/" + path;
34+ if (g_key_file_load_from_data_dirs(key_file, apps_path.toLocal8Bit().constData(), &full_path,
35+ G_KEY_FILE_NONE, nullptr)) {
36+ path = full_path;
37+ Q_EMIT activateApplication(path);
38+ } else {
39+ qWarning() << "Unable to activate " << path;
40 }
41+ g_key_file_free(key_file);
42+ g_free(full_path);
43 }
44-
45- Q_EMIT activateApplication(QFileInfo(path).baseName());
46 return;
47 }
48

Subscribers

People subscribed via source and target branches

to all changes: