summaryrefslogtreecommitdiffstats
path: root/kio
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-14 01:24:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-04-14 01:24:04 +0000
commit13da15f83844afa55de41ab2940541f5ae586187 (patch)
tree667d8773f3cf61ae3d63670a01e690de39bd2808 /kio
parentdbeab1b28062eafaa59edc13509ba3a348ed1853 (diff)
downloadtdelibs-13da15f83844afa55de41ab2940541f5ae586187.tar.gz
tdelibs-13da15f83844afa55de41ab2940541f5ae586187.zip
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
Diffstat (limited to 'kio')
-rw-r--r--kio/kio/krun.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/kio/kio/krun.cpp b/kio/kio/krun.cpp
index 8384e2c3d..8da71c8a0 100644
--- a/kio/kio/krun.cpp
+++ b/kio/kio/krun.cpp
@@ -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 );
}