diff --git a/src/plugins/nightcolor/nightcolordbusinterface.cpp b/src/plugins/nightcolor/nightcolordbusinterface.cpp index aeeb4d23f7..6526ba48f9 100644 --- a/src/plugins/nightcolor/nightcolordbusinterface.cpp +++ b/src/plugins/nightcolor/nightcolordbusinterface.cpp @@ -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 diff --git a/src/plugins/nightcolor/nightcolordbusinterface.h b/src/plugins/nightcolor/nightcolordbusinterface.h index c0c5be6c22..8dd06ec24e 100644 --- a/src/plugins/nightcolor/nightcolordbusinterface.h +++ b/src/plugins/nightcolor/nightcolordbusinterface.h @@ -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;