Commit 554c4185 authored by Marco Martin's avatar Marco Martin
Browse files

use libkworkspace for shutdown

parent 3b80e31f
......@@ -34,6 +34,9 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
WindowSystem
)
find_package(LibKWorkspace 5.15 CONFIG REQUIRED)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Quick
Core
......
......@@ -37,8 +37,6 @@ AbstractIndicator {
}
onClicked: {
var service = dataEngine.serviceForSource("PowerDevil");
var operation = service.operationDescription("requestShutDown");
service.startOperationCall(operation);
plasmoid.nativeInterface.requestShutdown();
}
}
......@@ -22,6 +22,7 @@ target_link_libraries(plasma_containment_biglauncherhomescreen
KF5::Notifications
KF5::Service KF5::KIOWidgets
KF5::Activities
PW::KWorkspace
KF5::ActivitiesStats)
install(TARGETS plasma_containment_biglauncherhomescreen DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
......
......@@ -25,8 +25,11 @@
#include <QProcess>
#include <QtQml>
#include <sessionmanagement.h>
HomeScreen::HomeScreen(QObject *parent, const QVariantList &args)
: Plasma::Containment(parent, args)
: Plasma::Containment(parent, args),
m_session(new SessionManagement(this))
{
const QByteArray uri("org.kde.private.biglauncher");
qmlRegisterUncreatableType<ApplicationListModel>(uri, 1, 0, "ApplicationListModel", QStringLiteral("Cannot create an item of type ApplicationListModel"));
......@@ -50,6 +53,11 @@ void HomeScreen::executeCommand(const QString &command)
QProcess::startDetached(command);
}
void HomeScreen::requestShutdown()
{
m_session->requestShutdown();
}
K_EXPORT_PLASMA_APPLET_WITH_JSON(homescreen, HomeScreen, "metadata.json")
#include "biglauncherhomescreen.moc"
......@@ -24,6 +24,7 @@
#include <Plasma/Containment>
class ApplicationListModel;
class SessionManagement;
class HomeScreen : public Plasma::Containment
{
......@@ -38,9 +39,11 @@ public:
public Q_SLOTS:
void executeCommand(const QString &command);
void requestShutdown();
private:
ApplicationListModel *m_applicationListModel;
SessionManagement *m_session;
};
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