Commit 8d31e6b8 authored by Bhushan Shah's avatar Bhushan Shah

switch to krunner for launching applications

KRun was ported to kf5 since long time..

CCMAIL: notmart@gmail.com
parent 63358567
......@@ -241,7 +241,6 @@ Q_INVOKABLE void ApplicationListModel::moveItem(int row, int destination)
endMoveRows();
}
//TODO: the implementation of runApplicationKRun should be the only one remaining
void ApplicationListModel::runApplication(const QString &storageId)
{
if (storageId.isEmpty()) {
......@@ -250,23 +249,6 @@ void ApplicationListModel::runApplication(const QString &storageId)
KService::Ptr service = KService::serviceByStorageId(storageId);
//ignore parameters like %u
QStringList args = KShell::splitArgs(service->exec().replace(QRegExp("%\\w"), ""));
QString exec = args.takeFirst();
qDebug() << "exec -> " << exec;
qDebug() << "args -> " << args;
qDebug() << "path -> " << service->path();
QProcess::startDetached(exec, args, service->path());
}
void ApplicationListModel::runApplicationKRun(const QString &storageId)
{
if (storageId.isEmpty()) {
return;
}
KService::Ptr service = KService::serviceByStorageId(storageId);
KRun::run(*service, QList<QUrl>(), 0);
}
......
......@@ -71,8 +71,6 @@ public:
Q_INVOKABLE void runApplication(const QString &storageId);
Q_INVOKABLE void runApplicationKRun(const QString &storageId);
Q_INVOKABLE void loadApplications();
public Q_SLOTS:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment