diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,8 @@ KF5::IdleTime KF5::GlobalAccel KF5::Notifications - KF5::XmlGui + KF5::CoreAddons + KF5::ConfigGui KF5::Crash KF5::WindowSystem ${X11_LIBRARIES} diff --git a/ksldapp.h b/ksldapp.h --- a/ksldapp.h +++ b/ksldapp.h @@ -31,7 +31,6 @@ // forward declarations class GlobalAccel; class LogindIntegration; -class KActionCollection; class QTimer; class KSldTest; @@ -72,9 +71,6 @@ KSldApp(QObject * parent = 0); virtual ~KSldApp(); - // The action collection of the active widget - KActionCollection* actionCollection(); - LockState lockState() const { return m_lockState; } @@ -127,7 +123,6 @@ void doUnlock(); bool isFdoPowerInhibited() const; - KActionCollection *m_actionCollection; LockState m_lockState; QProcess *m_lockProcess; AbstractLocker *m_lockWindow; diff --git a/ksldapp.cpp b/ksldapp.cpp --- a/ksldapp.cpp +++ b/ksldapp.cpp @@ -31,7 +31,6 @@ #include #include "waylandserver.h" // KDE -#include #include #include #include @@ -79,7 +78,6 @@ KSldApp::KSldApp(QObject * parent) : QObject(parent) - , m_actionCollection(NULL) , m_lockState(Unlocked) , m_lockProcess(NULL) , m_lockWindow(NULL) @@ -111,7 +109,6 @@ if (m_lockProcess && m_lockProcess->state() != QProcess::NotRunning) { m_lockProcess->terminate(); } - delete m_actionCollection; delete m_lockProcess; delete m_lockWindow; @@ -168,20 +165,19 @@ } // Global keys - m_actionCollection = new KActionCollection(this); - if (KAuthorized::authorizeKAction(QStringLiteral("lock_screen"))) { qDebug() << "Configuring Lock Action"; - QAction *a = m_actionCollection->addAction(QStringLiteral("Lock Session")); + QAction *a = new QAction(this); + a->setObjectName(QStringLiteral("Lock Session")); + a->setProperty("componentName", QStringLiteral("ksmserver")); a->setText(i18n("Lock Session")); KGlobalAccel::self()->setGlobalShortcut(a, QList() << Qt::ALT+Qt::CTRL+Qt::Key_L << Qt::Key_ScreenSaver ); connect(a, &QAction::triggered, this, [this]() { lock(EstablishLock::Immediate); } ); } - m_actionCollection->readSettings(); // idle support auto idleTimeSignal = static_cast(&KIdleTime::timeoutReached); @@ -390,11 +386,6 @@ startLockProcess(establishLock); } -KActionCollection *KSldApp::actionCollection() -{ - return m_actionCollection; -} - /* * Forward declarations: * Only called from KSldApp::establishGrab(). Using from somewhere else is incorrect usage!