mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 08:44:45 +00:00
Adapt to renamed night light d-bus interface
This commit is contained in:
parent
becd4b64e1
commit
17f0674cc2
3 changed files with 10 additions and 7 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
# SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
# SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
set_source_files_properties(${KWIN_COLORCORRECT_INTERFACE} PROPERTIES NO_NAMESPACE TRUE)
|
set_source_files_properties(${KWIN_NIGHTLIGHT_INTERFACE} PROPERTIES NO_NAMESPACE TRUE)
|
||||||
qt_add_dbus_interfaces(DBUS_SRCS ${KWIN_COLORCORRECT_INTERFACE})
|
qt_add_dbus_interfaces(DBUS_SRCS ${KWIN_NIGHTLIGHT_INTERFACE})
|
||||||
|
|
||||||
set(nightcolorplugin_SRCS
|
set(nightcolorplugin_SRCS
|
||||||
nightcolorplugin.cpp
|
nightcolorplugin.cpp
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,10 @@
|
||||||
|
|
||||||
NightColorUtil::NightColorUtil(QObject *parent)
|
NightColorUtil::NightColorUtil(QObject *parent)
|
||||||
: QObject{parent}
|
: QObject{parent}
|
||||||
, m_ccInterface{new OrgKdeKwinColorCorrectInterface(QStringLiteral("org.kde.KWin"), QStringLiteral("/ColorCorrect"), QDBusConnection::sessionBus(), this)}
|
, m_ccInterface{new OrgKdeKWinNightLightInterface(QStringLiteral("org.kde.KWin.NightLight"),
|
||||||
|
QStringLiteral("/org/kde/KWin/NightLight"),
|
||||||
|
QDBusConnection::sessionBus(),
|
||||||
|
this)}
|
||||||
, m_settings{new NightColorSettings(this)}
|
, m_settings{new NightColorSettings(this)}
|
||||||
{
|
{
|
||||||
if (!m_ccInterface->isValid()) {
|
if (!m_ccInterface->isValid()) {
|
||||||
|
|
@ -17,8 +20,8 @@ NightColorUtil::NightColorUtil(QObject *parent)
|
||||||
m_enabled = m_ccInterface->running();
|
m_enabled = m_ccInterface->running();
|
||||||
|
|
||||||
// subscribe to property updates
|
// subscribe to property updates
|
||||||
QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.KWin"),
|
QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.KWin.NightLight"),
|
||||||
QStringLiteral("/ColorCorrect"),
|
QStringLiteral("/org/kde/KWin/NightLight"),
|
||||||
QStringLiteral("org.freedesktop.DBus.Properties"),
|
QStringLiteral("org.freedesktop.DBus.Properties"),
|
||||||
QStringLiteral("PropertiesChanged"),
|
QStringLiteral("PropertiesChanged"),
|
||||||
this,
|
this,
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "colorcorrectinterface.h"
|
|
||||||
#include "nightcolorsettings.h"
|
#include "nightcolorsettings.h"
|
||||||
|
#include "nightlightinterface.h"
|
||||||
|
|
||||||
class NightColorUtil : public QObject
|
class NightColorUtil : public QObject
|
||||||
{
|
{
|
||||||
|
|
@ -30,6 +30,6 @@ public Q_SLOTS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_enabled;
|
bool m_enabled;
|
||||||
OrgKdeKwinColorCorrectInterface *m_ccInterface;
|
OrgKdeKWinNightLightInterface *m_ccInterface;
|
||||||
NightColorSettings *m_settings;
|
NightColorSettings *m_settings;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue