mirror of
https://github.com/KDE/konsole.git
synced 2026-05-18 19:47:16 -04:00
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
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <sys/sysctl.h>
|
||||
#include <libproc.h>
|
||||
#ifdef HAVE_SYS_PROC_INFO_H
|
||||
#include <sys/proc_info.h>
|
||||
#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)
|
||||
|
||||
Reference in New Issue
Block a user