Set the working directory to the same directory as the executable when running an executable directly in konqueror

Fixes Bug 168


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

@ -853,8 +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 ) );
return runCommandInternal( proc, service.data(), binaryName( execName, false ), execName, iconName,
window, asn );
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('/')));
return runCommandInternal( proc, service.data(), binaryName( execName, false ), execName, iconName, window, asn );
}
KRun::KRun( const KURL& url, mode_t mode, bool isLocalFile, bool showProgressInfo )

Loading…
Cancel
Save