Set working path properly when running executable in Konqueror

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1114572 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 15 years ago
parent dbeab1b280
commit 13da15f838

@ -853,10 +853,11 @@ pid_t KRun::runCommand( const QString& cmd, const QString &execName, const QStri
proc->setUseShell(true);
*proc << cmd;
KService::Ptr service = KService::serviceByDesktopName( binaryName( execName, true ) );
QStringList args = KShell::splitArgs( cmd );
for (QStringList::ConstIterator it = args.begin(); it != args.end(); ++it)
if (!(*it).contains('='))
proc->setWorkingDirectory((*it).mid(0, (*it).findRev('/')));
QString bin = binaryName( cmd, false );
int pos = bin.findRev( '/' );
if (pos != -1) {
proc->setWorkingDirectory( bin.mid(0, pos) );
}
return runCommandInternal( proc, service.data(), binaryName( execName, false ), execName, iconName, window, asn );
}

Loading…
Cancel
Save