plugins/nightcolor: Register its own service name
In order to make monitoring Night Color appearing and disappearing robust, make Night Color register its own dbus service. CCBUG: 428854
This commit is contained in:
parent
a6a022f00f
commit
8d04733682
2 changed files with 7 additions and 1 deletions
|
@ -174,6 +174,12 @@ NightColorDBusInterface::NightColorDBusInterface(NightColorManager *parent)
|
|||
|
||||
new ColorCorrectAdaptor(this);
|
||||
QDBusConnection::sessionBus().registerObject(QStringLiteral("/ColorCorrect"), this);
|
||||
QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.NightColor"));
|
||||
}
|
||||
|
||||
NightColorDBusInterface::~NightColorDBusInterface()
|
||||
{
|
||||
QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.NightColor"));
|
||||
}
|
||||
|
||||
bool NightColorDBusInterface::isInhibited() const
|
||||
|
|
|
@ -35,7 +35,7 @@ class NightColorDBusInterface : public QObject, public QDBusContext
|
|||
|
||||
public:
|
||||
explicit NightColorDBusInterface(NightColorManager *parent);
|
||||
~NightColorDBusInterface() override = default;
|
||||
~NightColorDBusInterface() override;
|
||||
|
||||
bool isInhibited() const;
|
||||
bool isEnabled() const;
|
||||
|
|
Loading…
Reference in a new issue