mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 02:34:45 +00:00
switch to krunner for launching applications
KRun was ported to kf5 since long time.. CCMAIL: notmart@gmail.com
This commit is contained in:
parent
63358567d7
commit
8d31e6b819
2 changed files with 0 additions and 20 deletions
|
|
@ -241,7 +241,6 @@ Q_INVOKABLE void ApplicationListModel::moveItem(int row, int destination)
|
||||||
endMoveRows();
|
endMoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: the implementation of runApplicationKRun should be the only one remaining
|
|
||||||
void ApplicationListModel::runApplication(const QString &storageId)
|
void ApplicationListModel::runApplication(const QString &storageId)
|
||||||
{
|
{
|
||||||
if (storageId.isEmpty()) {
|
if (storageId.isEmpty()) {
|
||||||
|
|
@ -250,23 +249,6 @@ void ApplicationListModel::runApplication(const QString &storageId)
|
||||||
|
|
||||||
KService::Ptr service = KService::serviceByStorageId(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);
|
KRun::run(*service, QList<QUrl>(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,6 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE void runApplication(const QString &storageId);
|
Q_INVOKABLE void runApplication(const QString &storageId);
|
||||||
|
|
||||||
Q_INVOKABLE void runApplicationKRun(const QString &storageId);
|
|
||||||
|
|
||||||
Q_INVOKABLE void loadApplications();
|
Q_INVOKABLE void loadApplications();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue