Merge lp:~osomon/unity-2d/dash-set-cwd-home into lp:unity-2d/3.0

Proposed by Olivier Tilloy
Status: Merged
Approved by: Bill Filler
Approved revision: 532
Merged at revision: 534
Proposed branch: lp:~osomon/unity-2d/dash-set-cwd-home
Merge into: lp:unity-2d/3.0
Diff against target: 25 lines (+8/-0)
1 file modified
places/app/places.cpp (+8/-0)
To merge this branch: bzr merge lp:~osomon/unity-2d/dash-set-cwd-home
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
Review via email: mp+57493@code.launchpad.net

Commit message

[dash] Set the current working directory to $HOME so that applications started from the dash inherit a sane environment.

To post a comment you must log in.
Revision history for this message
Bill Filler (bfiller) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/app/places.cpp'
2--- places/app/places.cpp 2011-03-16 16:51:20 +0000
3+++ places/app/places.cpp 2011-04-13 13:49:22 +0000
4@@ -27,6 +27,7 @@
5 #include <QDBusConnectionInterface>
6 #include <QDeclarativeContext>
7 #include <QAbstractEventDispatcher>
8+#include <QDir>
9
10 #include <X11/Xlib.h>
11
12@@ -87,6 +88,13 @@
13 view.rootContext()->setContextProperty("engineBaseUrl", view.engine()->baseUrl().toLocalFile());
14 view.setSource(QUrl("./dash.qml"));
15
16+ /* When spawned via DBus activation, the current working directory is
17+ inherited from the DBus daemon, and it usually is not the user’s home
18+ directory. Applications launched from the dash in turn inherit their
19+ current working directory from the dash, and they expect a sane default
20+ (see e.g. https://bugs.launchpad.net/bugs/684471). */
21+ QDir::setCurrent(QDir::homePath());
22+
23 application.setProperty("view", QVariant::fromValue(&view));
24 return application.exec();
25 }

Subscribers

People subscribed via source and target branches