mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Port to ApplicationLauncherJob
This commit is contained in:
parent
9cbb53744f
commit
4f13a58241
3 changed files with 10 additions and 6 deletions
|
|
@ -3,7 +3,7 @@ project(plasma-phone-components)
|
||||||
# minimal requirements
|
# minimal requirements
|
||||||
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
|
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
|
||||||
set (QT_MIN_VERSION "5.12.0")
|
set (QT_MIN_VERSION "5.12.0")
|
||||||
set(KF5_MIN_VERSION "5.66.0")
|
set(KF5_MIN_VERSION "5.70.0")
|
||||||
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
@ -33,6 +33,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
||||||
Plasma
|
Plasma
|
||||||
PlasmaQuick
|
PlasmaQuick
|
||||||
Service
|
Service
|
||||||
|
Notifications
|
||||||
)
|
)
|
||||||
find_package(KF5Wayland CONFIG)
|
find_package(KF5Wayland CONFIG)
|
||||||
set_package_properties(KF5Wayland PROPERTIES
|
set_package_properties(KF5Wayland PROPERTIES
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ target_link_libraries(plasma_containment_phone_homescreen
|
||||||
Qt5::Quick
|
Qt5::Quick
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::Service
|
KF5::Service
|
||||||
KF5::KIOWidgets
|
KF5::KIOGui
|
||||||
|
KF5::Notifications
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,16 @@
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
// KDE
|
// KDE
|
||||||
|
#include <KIO/ApplicationLauncherJob>
|
||||||
|
#include <KNotificationJobUiDelegate>
|
||||||
#include <KService>
|
#include <KService>
|
||||||
#include <KServiceGroup>
|
#include <KServiceGroup>
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
#include <KSycoca>
|
#include <KSycoca>
|
||||||
#include <KSycocaEntry>
|
#include <KSycocaEntry>
|
||||||
#include <KIOWidgets/KRun>
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
constexpr int MAX_FAVOURITES = 5;
|
constexpr int MAX_FAVOURITES = 5;
|
||||||
|
|
||||||
|
|
@ -325,8 +326,9 @@ void ApplicationListModel::runApplication(const QString &storageId)
|
||||||
}
|
}
|
||||||
|
|
||||||
KService::Ptr service = KService::serviceByStorageId(storageId);
|
KService::Ptr service = KService::serviceByStorageId(storageId);
|
||||||
|
KIO::ApplicationLauncherJob *job = new KIO::ApplicationLauncherJob(service);
|
||||||
KRun::runService(*service, QList<QUrl>(), nullptr);
|
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
|
||||||
|
job->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ApplicationListModel::maxFavoriteCount() const
|
int ApplicationListModel::maxFavoriteCount() const
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue