mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 07:03:08 +00:00
a KRun based way to launch apps
needs the duplicate for now in order to test without breaking the image
This commit is contained in:
parent
c94b6c348c
commit
e75c8005d3
4 changed files with 17 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ include(FeatureSummary)
|
|||
|
||||
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Gui Widgets Qml Quick Test)
|
||||
|
||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma Service Declarative I18n)
|
||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma Service Declarative I18n KIO)
|
||||
find_package(KF5 REQUIRED COMPONENTS PlasmaQuick DBusAddons Notifications)
|
||||
find_package(KF5Wayland CONFIG)
|
||||
set_package_properties(KF5Wayland PROPERTIES
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ target_link_libraries(plasma_containment_phone_homescreen
|
|||
Qt5::Qml
|
||||
KF5::I18n
|
||||
KF5::Service
|
||||
KF5::KIOWidgets
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include <KSharedConfig>
|
||||
#include <KSycoca>
|
||||
#include <KSycocaEntry>
|
||||
#include <KIOWidgets/KRun>
|
||||
#include <QDebug>
|
||||
|
||||
ApplicationListModel::ApplicationListModel(QObject *parent)
|
||||
|
|
@ -218,6 +219,7 @@ 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()) {
|
||||
|
|
@ -230,6 +232,17 @@ void ApplicationListModel::runApplication(const QString &storageId)
|
|||
QProcess::startDetached(service->exec().replace(QRegExp("%\\w"), ""));
|
||||
}
|
||||
|
||||
void ApplicationListModel::runApplicationKRun(const QString &storageId)
|
||||
{
|
||||
if (storageId.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
KService::Ptr service = KService::serviceByStorageId(storageId);
|
||||
|
||||
KRun::run(*service, QList<QUrl>(), 0);
|
||||
}
|
||||
|
||||
QStringList ApplicationListModel::appOrder() const
|
||||
{
|
||||
return m_appOrder;
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ public:
|
|||
|
||||
Q_INVOKABLE void runApplication(const QString &storageId);
|
||||
|
||||
Q_INVOKABLE void runApplicationKRun(const QString &storageId);
|
||||
|
||||
Q_INVOKABLE void loadApplications();
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
|
|||
Loading…
Reference in a new issue