From 71a9a5d3d899f6e833dc2f9dde29267748e8ba60 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Tue, 12 Oct 2010 21:11:17 +0000 Subject: [PATCH] For Q_OS_MAC, obtain the current directory. There is still the issue of when it is a symlink that the linked directory is given, not the symlink. svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1185298 --- src/ProcessInfo.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index 37f6ee0cb..92b49b8fe 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -43,6 +43,7 @@ #if defined(Q_OS_MAC) #include +#include #ifdef HAVE_SYS_PROC_INFO_H #include #endif @@ -807,7 +808,13 @@ private: } virtual bool readCurrentDir(int pid) { - Q_UNUSED(pid); + struct proc_vnodepathinfo vpi; + int nb = proc_pidinfo(pid, PROC_PIDVNODEPATHINFO, 0, &vpi, sizeof(vpi)); + if (nb == sizeof(vpi)) + { + setCurrentDir(QString(vpi.pvi_cdir.vip_path)); + return true; + } return false; } virtual bool readEnvironment(int pid)