From b3e1fbea953bc15e6c4e984029c37e1c5726534a Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Sun, 21 Jun 2015 01:53:27 +0200 Subject: [PATCH] Specify the required CWD when running the applications --- containments/homescreen/applicationlistmodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/containments/homescreen/applicationlistmodel.cpp b/containments/homescreen/applicationlistmodel.cpp index 3db36498..71563d82 100644 --- a/containments/homescreen/applicationlistmodel.cpp +++ b/containments/homescreen/applicationlistmodel.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -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)