Merge lp:~fboucault/unity-2d/support_install_in_symlink into lp:unity-2d

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 897
Merged at revision: 897
Proposed branch: lp:~fboucault/unity-2d/support_install_in_symlink
Merge into: lp:unity-2d
Diff against target: 77 lines (+13/-11)
3 files modified
config.h.in (+3/-1)
launcher/app/launcherview.cpp (+7/-7)
libunity-2d-private/src/unity2ddeclarativeview.cpp (+3/-3)
To merge this branch: bzr merge lp:~fboucault/unity-2d/support_install_in_symlink
Reviewer Review Type Date Requested Status
Ugo Riboni Pending
Review via email: mp+91706@code.launchpad.net

Description of the change

Support running installed inside a directory that is a symlink.

isRunningInstalled() is made more reliable by resolving all symlinks contained
in the installation path.
Header inclusions were shuffled around to respect the best practice to include
from the more local to the more global headers and to solve a compilation error
as a result.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.h.in'
2--- config.h.in 2012-01-24 09:54:34 +0000
3+++ config.h.in 2012-02-06 19:50:23 +0000
4@@ -6,6 +6,7 @@
5 #define UNITY_2D_SCHEMA_FILE "@UNITY_2D_SCHEMA_FILE@"
6
7 #include <QCoreApplication>
8+#include <QDir>
9 #include "qconf.h"
10
11 static const char* UNITY2D_DCONF_SCHEMA = "com.canonical.Unity2d";
12@@ -54,7 +55,8 @@
13
14
15 inline bool isRunningInstalled() {
16- return (QCoreApplication::applicationDirPath() == (INSTALL_PREFIX "/" INSTALL_BINDIR));
17+ static bool installed = (QCoreApplication::applicationDirPath() == QDir((INSTALL_PREFIX "/" INSTALL_BINDIR)).canonicalPath());
18+ return installed;
19 }
20
21 inline QString unity2dDirectory() {
22
23=== modified file 'launcher/app/launcherview.cpp'
24--- launcher/app/launcherview.cpp 2011-11-25 11:13:44 +0000
25+++ launcher/app/launcherview.cpp 2012-02-06 19:50:23 +0000
26@@ -19,6 +19,13 @@
27
28 #include "launcherview.h"
29
30+#include <config.h>
31+#include <keyboardmodifiersmonitor.h>
32+#include <hotkey.h>
33+#include <hotkeymonitor.h>
34+#include <keymonitor.h>
35+#include <debug_p.h>
36+
37 #include <QApplication>
38 #include <QDesktopWidget>
39 #include <QX11Info>
40@@ -37,13 +44,6 @@
41 #include <X11/Xlib.h>
42 #include <X11/Xatom.h>
43
44-#include <keyboardmodifiersmonitor.h>
45-#include <hotkey.h>
46-#include <hotkeymonitor.h>
47-#include <keymonitor.h>
48-#include <debug_p.h>
49-#include <config.h>
50-
51 static const int KEY_HOLD_THRESHOLD = 250;
52
53 static const char* DASH_DBUS_SERVICE = "com.canonical.Unity2d.Dash";
54
55=== modified file 'libunity-2d-private/src/unity2ddeclarativeview.cpp'
56--- libunity-2d-private/src/unity2ddeclarativeview.cpp 2012-02-03 20:59:54 +0000
57+++ libunity-2d-private/src/unity2ddeclarativeview.cpp 2012-02-06 19:50:23 +0000
58@@ -16,6 +16,9 @@
59
60 #include "unity2ddeclarativeview.h"
61
62+#include <debug_p.h>
63+#include <config.h>
64+
65 #include <QDebug>
66 #include <QGLWidget>
67 #include <QVariant>
68@@ -26,9 +29,6 @@
69 #include <X11/Xlib.h>
70 #include <X11/Xatom.h>
71
72-#include <debug_p.h>
73-#include <config.h>
74-
75 // libwnck
76 extern "C" {
77 #include <libwnck/libwnck.h>

Subscribers

People subscribed via source and target branches