Specify the required CWD when running the applications

This commit is contained in:
Aleix Pol 2015-06-21 01:53:27 +02:00
parent d4e675ec27
commit b3e1fbea95

View file

@ -33,6 +33,7 @@
#include <KSharedConfig>
#include <KSycoca>
#include <KSycocaEntry>
#include <KShell>
#include <KIOWidgets/KRun>
#include <QDebug>
@ -241,8 +242,10 @@ void ApplicationListModel::runApplication(const QString &storageId)
KService::Ptr service = KService::serviceByStorageId(storageId);
QStringList args = KShell::splitArgs(service->exec().replace(QRegExp("%\\w"), ""));
QString exec = args.takeFirst();
//ignore parameters like %u
QProcess::startDetached(service->exec().replace(QRegExp("%\\w"), ""));
QProcess::startDetached(exec, args, service->path());
}
void ApplicationListModel::runApplicationKRun(const QString &storageId)