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
=== modified file 'places/app/places.cpp'
--- places/app/places.cpp 2011-03-16 16:51:20 +0000
+++ places/app/places.cpp 2011-04-13 13:49:22 +0000
@@ -27,6 +27,7 @@
27#include <QDBusConnectionInterface>27#include <QDBusConnectionInterface>
28#include <QDeclarativeContext>28#include <QDeclarativeContext>
29#include <QAbstractEventDispatcher>29#include <QAbstractEventDispatcher>
30#include <QDir>
3031
31#include <X11/Xlib.h>32#include <X11/Xlib.h>
3233
@@ -87,6 +88,13 @@
87 view.rootContext()->setContextProperty("engineBaseUrl", view.engine()->baseUrl().toLocalFile());88 view.rootContext()->setContextProperty("engineBaseUrl", view.engine()->baseUrl().toLocalFile());
88 view.setSource(QUrl("./dash.qml"));89 view.setSource(QUrl("./dash.qml"));
8990
91 /* When spawned via DBus activation, the current working directory is
92 inherited from the DBus daemon, and it usually is not the user’s home
93 directory. Applications launched from the dash in turn inherit their
94 current working directory from the dash, and they expect a sane default
95 (see e.g. https://bugs.launchpad.net/bugs/684471). */
96 QDir::setCurrent(QDir::homePath());
97
90 application.setProperty("view", QVariant::fromValue(&view));98 application.setProperty("view", QVariant::fromValue(&view));
91 return application.exec();99 return application.exec();
92}100}

Subscribers

People subscribed via source and target branches