Commit 1cdb7ae4 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Kicker System Entry] Remove KDisplayManager global static

It is only used in one place and cached, so no need for a global static that is created
as soon as the plugin is loaded.

Differential Revision: https://phabricator.kde.org/D13999
parent 07d38f75
......@@ -32,8 +32,6 @@
#include "ksmserver_interface.h"
#include <kworkspace5/kdisplaymanager.h>
KDisplayManager *SystemEntry::m_displayManager = new KDisplayManager();
SystemEntry::SystemEntry(AbstractModel *owner, Action action) : AbstractEntry(owner)
, m_action(action)
, m_valid(false)
......@@ -92,7 +90,7 @@ void SystemEntry::init()
}
case SwitchUser:
m_valid = (KAuthorized::authorizeAction("start_new_session") || KAuthorized::authorizeAction("switch_user"))
&& m_displayManager->isSwitchable();
&& KDisplayManager().isSwitchable();
break;
case SuspendToRam:
m_valid = Solid::PowerManagement::supportedSleepStates().contains(Solid::PowerManagement::SuspendState);
......
......@@ -22,8 +22,6 @@
#include "abstractentry.h"
class KDisplayManager;
class SystemEntry : public AbstractEntry
{
public:
......@@ -63,7 +61,6 @@ class SystemEntry : public AbstractEntry
Action m_action;
bool m_valid;
static KDisplayManager *m_displayManager;
};
#endif
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