Commit bdfb9462 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Convert Night Color into a plugin

Night Color adjusts the color temperature based on the current time in
your location. It's not a generic color correction module per se.

We need a central component that can be used by both night color and
colord integration to tweak gamma ramps and which will be able to
resolve conflicts between the two. The Night Color manager cannot be
such a thing because of its very specific usecase.

This change converts Night Color into a plugin to prepare some space for
such a component.

The tricky part is that the dbus api of Night Color has "ColorCorrect"
in its name. I'm afraid we cannot do that much about it without breaking
API compatibility.
parent 2bac328c
......@@ -452,11 +452,6 @@ set(kwin_SRCS
appmenu.cpp
atoms.cpp
client_machine.cpp
colorcorrection/clockskewnotifier.cpp
colorcorrection/clockskewnotifierengine.cpp
colorcorrection/colorcorrectdbusinterface.cpp
colorcorrection/manager.cpp
colorcorrection/suncalc.cpp
composite.cpp
cursor.cpp
dbusinterface.cpp
......@@ -567,25 +562,6 @@ set(kwin_SRCS
xwl/xwayland_interface.cpp
)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(kwin_SRCS
${kwin_SRCS}
colorcorrection/clockskewnotifierengine_linux.cpp
)
endif()
include(ECMQtDeclareLoggingCategory)
ecm_qt_declare_logging_category(kwin_SRCS
HEADER
colorcorrect_logging.h
IDENTIFIER
KWIN_COLORCORRECTION
CATEGORY_NAME
kwin_colorcorrection
DEFAULT_SEVERITY
Critical
)
if (KWIN_BUILD_TABBOX)
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
set(kwin_SRCS ${kwin_SRCS}
......@@ -626,13 +602,11 @@ if(KWIN_TTY_PREFIX)
endif()
kconfig_add_kcfg_files(kwin_SRCS settings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS colorcorrection/colorcorrect_settings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS rulesettings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS rulebooksettingsbase.kcfgc)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.ColorCorrect.xml colorcorrection/colorcorrectdbusinterface.h KWin::ColorCorrect::ColorCorrectDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager)
......@@ -816,13 +790,11 @@ endif()
########### install files ###############
install(FILES kwin.kcfg DESTINATION ${KCFG_INSTALL_DIR} RENAME ${KWIN_NAME}.kcfg)
install(FILES colorcorrection/colorcorrect_settings.kcfg DESTINATION ${KCFG_INSTALL_DIR} RENAME ${KWIN_NAME}_colorcorrect.kcfg)
install(FILES kwin.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR} RENAME ${KWIN_NAME}.notifyrc)
install(
FILES
org.kde.KWin.VirtualDesktopManager.xml
org.kde.KWin.xml
org.kde.kwin.ColorCorrect.xml
org.kde.kwin.Compositing.xml
org.kde.kwin.Effects.xml
org.kde.KWin.Plugins.xml
......
#! /usr/bin/env bash
$EXTRACTRC *.kcfg *.ui >> rc.cpp
$XGETTEXT *.h *.cpp colorcorrection/*.cpp helpers/killer/*.cpp plugins/scenes/opengl/*.cpp tabbox/*.cpp scripting/*.cpp plugins/krunner-integration/*.cpp -o $podir/kwin.pot
$XGETTEXT *.h *.cpp plugins/nightcolor/*.cpp helpers/killer/*.cpp plugins/scenes/opengl/*.cpp tabbox/*.cpp scripting/*.cpp plugins/krunner-integration/*.cpp -o $podir/kwin.pot
......@@ -89,7 +89,7 @@ integrationTest(WAYLAND_ONLY NAME testLayerShellV1Client SRCS layershellv1client
integrationTest(WAYLAND_ONLY NAME testVirtualDesktop SRCS virtual_desktop_test.cpp)
integrationTest(WAYLAND_ONLY NAME testXdgShellClientRules SRCS xdgshellclient_rules_test.cpp)
integrationTest(WAYLAND_ONLY NAME testIdleInhibition SRCS idle_inhibition_test.cpp)
integrationTest(WAYLAND_ONLY NAME testColorCorrectNightColor SRCS colorcorrect_nightcolor_test.cpp)
integrationTest(WAYLAND_ONLY NAME testNightColor SRCS nightcolor_test.cpp LIBS KWinNightColorPlugin)
integrationTest(WAYLAND_ONLY NAME testDontCrashCursorPhysicalSizeEmpty SRCS dont_crash_cursor_physical_size_empty.cpp)
integrationTest(WAYLAND_ONLY NAME testDontCrashReinitializeCompositor SRCS dont_crash_reinitialize_compositor.cpp)
integrationTest(WAYLAND_ONLY NAME testNoGlobalShortcuts SRCS no_global_shortcuts_test.cpp)
......
......@@ -7,19 +7,19 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "kwin_wayland_test.h"
#include "platform.h"
#include "wayland_server.h"
#include "colorcorrection/manager.h"
#include "colorcorrection/constants.h"
#include "plugins/nightcolor/nightcolormanager.h"
#include "plugins/nightcolor/constants.h"
#include <KConfigGroup>
using namespace KWin;
static const QString s_socketName = QStringLiteral("wayland_test_kwin_colorcorrect_nightcolor-0");
static const QString s_socketName = QStringLiteral("wayland_test_kwin_nightcolor-0");
class ColorCorrectNightColorTest : public QObject
class NightColorTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
......@@ -34,7 +34,7 @@ private Q_SLOTS:
void testAutoLocationUpdate();
};
void ColorCorrectNightColorTest::initTestCase()
void NightColorTest::initTestCase()
{
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
......@@ -47,19 +47,22 @@ void ColorCorrectNightColorTest::initTestCase()
kwinApp()->start();
QVERIFY(applicationStartedSpy.wait());
waylandServer()->initWorkspace();
NightColorManager *manager = NightColorManager::self();
QVERIFY(manager);
}
void ColorCorrectNightColorTest::init()
void NightColorTest::init()
{
QVERIFY(Test::setupWaylandConnection());
}
void ColorCorrectNightColorTest::cleanup()
void NightColorTest::cleanup()
{
Test::destroyWaylandConnection();
}
void ColorCorrectNightColorTest::testConfigRead_data()
void NightColorTest::testConfigRead_data()
{
QTest::addColumn<QString>("active");
QTest::addColumn<int>("mode");
......@@ -79,7 +82,7 @@ void ColorCorrectNightColorTest::testConfigRead_data()
QTest::newRow("wrongData2") << "fa" << 4 << 7000 << 91. << -181. << "060" << "800" << -2 << false;
}
void ColorCorrectNightColorTest::testConfigRead()
void NightColorTest::testConfigRead()
{
QFETCH(QString, active);
QFETCH(int, mode);
......@@ -93,7 +96,7 @@ void ColorCorrectNightColorTest::testConfigRead()
const bool activeDefault = true;
const int modeDefault = 0;
const int nightTemperatureUpperEnd = ColorCorrect::NEUTRAL_TEMPERATURE;
const int nightTemperatureUpperEnd = NEUTRAL_TEMPERATURE;
const double latitudeFixedDefault = 0;
const double longitudeFixedDefault = 0;
const QTime morningBeginFixedDefault = QTime(6,0,0);
......@@ -111,7 +114,7 @@ void ColorCorrectNightColorTest::testConfigRead()
cfgGroup.writeEntry("EveningBeginFixed", eveningBeginFixedDefault.toString("hhmm"));
cfgGroup.writeEntry("TransitionTime", transitionTimeDefault);
ColorCorrect::Manager *manager = kwinApp()->platform()->colorCorrectManager();
NightColorManager *manager = NightColorManager::self();
manager->reparseConfigAndReset();
auto info = manager->info();
QVERIFY(!info.isEmpty());
......@@ -159,7 +162,7 @@ void ColorCorrectNightColorTest::testConfigRead()
}
}
void ColorCorrectNightColorTest::testChangeConfiguration_data()
void NightColorTest::testChangeConfiguration_data()
{
QTest::addColumn<bool>("activeReadIn");
QTest::addColumn<int>("modeReadIn");
......@@ -186,7 +189,7 @@ void ColorCorrectNightColorTest::testChangeConfiguration_data()
QTest::newRow("wrongData8") << true << 0 << 4500 << 0. << 0. << QTime(1,0,0) << QTime(23,30,0) << 90 << false;
}
void ColorCorrectNightColorTest::testChangeConfiguration()
void NightColorTest::testChangeConfiguration()
{
QFETCH(bool, activeReadIn);
QFETCH(int, modeReadIn);
......@@ -200,7 +203,7 @@ void ColorCorrectNightColorTest::testChangeConfiguration()
const bool activeDefault = true;
const int modeDefault = 0;
const int nightTemperatureDefault = ColorCorrect::DEFAULT_NIGHT_TEMPERATURE;
const int nightTemperatureDefault = DEFAULT_NIGHT_TEMPERATURE;
const double latitudeFixedDefault = 0;
const double longitudeFixedDefault = 0;
const QTime morningBeginFixedDefault = QTime(6,0,0);
......@@ -258,7 +261,7 @@ void ColorCorrectNightColorTest::testChangeConfiguration()
QCOMPARE(info.value("TransitionTime").toInt(), transitionTimeExpect);
};
ColorCorrect::Manager *manager = kwinApp()->platform()->colorCorrectManager();
NightColorManager *manager = NightColorManager::self();
// test with default values
setData();
......@@ -292,9 +295,9 @@ void ColorCorrectNightColorTest::testChangeConfiguration()
compareValues(manager->info());
}
void ColorCorrectNightColorTest::testAutoLocationUpdate()
void NightColorTest::testAutoLocationUpdate()
{
ColorCorrect::Manager *manager = kwinApp()->platform()->colorCorrectManager();
NightColorManager *manager = NightColorManager::self();
auto info = manager->info();
QCOMPARE(info.value("LatitudeAuto").toDouble(), 0.);
QCOMPARE(info.value("LongitudeAuto").toDouble(), 0.);
......@@ -324,5 +327,5 @@ void ColorCorrectNightColorTest::testAutoLocationUpdate()
QCOMPARE(info.value("LatitudeAuto").toDouble(), 50.);
}
WAYLANDTEST_MAIN(ColorCorrectNightColorTest)
#include "colorcorrect_nightcolor_test.moc"
WAYLANDTEST_MAIN(NightColorTest)
#include "nightcolor_test.moc"
File=colorcorrect_settings.kcfg
NameSpace=KWin::ColorCorrect
ClassName=Settings
Singleton=true
Mutators=true
# manager.h is needed for NightColorMode
IncludeFiles=colorcorrection/manager.h
UseEnumTypes=true
......@@ -21,7 +21,6 @@
#include "screens.h"
#include "screenedge.h"
#include "wayland_server.h"
#include "colorcorrection/manager.h"
#include <KWaylandServer/outputconfiguration_interface.h>
#include <KWaylandServer/outputchangeset.h>
......@@ -38,7 +37,6 @@ Platform::Platform(QObject *parent)
, m_eglDisplay(EGL_NO_DISPLAY)
{
setSoftwareCursorForced(false);
m_colorCorrect = new ColorCorrect::Manager(this);
connect(Cursors::self(), &Cursors::currentCursorRendered, this, &Platform::cursorRendered);
}
......
......@@ -28,9 +28,6 @@ class OutputConfigurationInterface;
namespace KWin
{
namespace ColorCorrect {
class Manager;
}
class AbstractOutput;
class Edge;
......@@ -418,10 +415,6 @@ public:
return m_supportsGammaControl;
}
ColorCorrect::Manager *colorCorrectManager() {
return m_colorCorrect;
}
// outputs with connections (org_kde_kwin_outputdevice)
virtual Outputs outputs() const {
return Outputs();
......@@ -571,7 +564,6 @@ private:
EGLContext m_context = EGL_NO_CONTEXT;
EGLContext m_globalShareContext = EGL_NO_CONTEXT;
int m_hideCursorCounter = 0;
ColorCorrect::Manager *m_colorCorrect = nullptr;
bool m_supportsGammaControl = false;
bool m_supportsOutputChanges = false;
CompositingType m_selectedCompositor = NoCompositing;
......
......@@ -5,6 +5,7 @@ add_subdirectory(platforms)
add_subdirectory(scenes)
add_subdirectory(windowsystem)
add_subdirectory(kpackage)
add_subdirectory(nightcolor)
if (KWIN_BUILD_DECORATIONS)
add_subdirectory(kdecorations)
......
set(nightcolor_SOURCES
clockskewnotifier.cpp
clockskewnotifierengine.cpp
nightcolordbusinterface.cpp
nightcolormanager.cpp
main.cpp
suncalc.cpp
)
ecm_qt_declare_logging_category(nightcolor_SOURCES
HEADER nightcolorlogging.h
IDENTIFIER KWIN_NIGHTCOLOR
CATEGORY_NAME kwin_nightcolor
DEFAULT_SEVERITY Critical
)
kconfig_add_kcfg_files(nightcolor_SOURCES nightcolorsettings.kcfgc)
qt5_add_dbus_adaptor(nightcolor_SOURCES org.kde.kwin.ColorCorrect.xml
nightcolordbusinterface.h KWin::NightColorDBusInterface)
add_library(KWinNightColorPlugin SHARED ${nightcolor_SOURCES})
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_sources(KWinNightColorPlugin PRIVATE clockskewnotifierengine_linux.cpp)
endif()
target_link_libraries(KWinNightColorPlugin kwin)
install(FILES nightcolorsettings.kcfg DESTINATION ${KCFG_INSTALL_DIR} RENAME ${KWIN_NAME}_colorcorrect.kcfg)
install(FILES org.kde.kwin.ColorCorrect.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
install(TARGETS KWinNightColorPlugin DESTINATION ${PLUGIN_INSTALL_DIR}/kwin/plugins/)
......@@ -11,8 +11,6 @@
namespace KWin
{
namespace ColorCorrect
{
static const int MSC_DAY = 86400000;
static const int MIN_TEMPERATURE = 1000;
......@@ -272,7 +270,6 @@ static const float blackbodyColor[] = {
0.62740336, 0.75282962, 1.00000000
};
}
}
#endif // KWIN_NIGHTCOLOR_CONSTANTS_H
/*
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "nightcolormanager.h"
#include <KPluginFactory>
using namespace KWin;
class KWIN_EXPORT NightColorManagerFactory : public PluginFactory
{
Q_OBJECT
Q_PLUGIN_METADATA(IID PluginFactory_iid FILE "metadata.json")
Q_INTERFACES(KWin::PluginFactory)
public:
explicit NightColorManagerFactory(QObject *parent = nullptr);
Plugin *create() const override;
};
NightColorManagerFactory::NightColorManagerFactory(QObject *parent)
: PluginFactory(parent)
{
}
Plugin *NightColorManagerFactory::create() const
{
return new NightColorManager();
}
K_EXPORT_PLUGIN_VERSION(KWIN_PLUGIN_API_VERSION)
#include "main.moc"
{
"KPlugin": {
"EnabledByDefault": true,
"Id": "kwin5_plugin_nightcolor"
}
}
......@@ -7,17 +7,15 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "colorcorrectdbusinterface.h"
#include "nightcolordbusinterface.h"
#include "nightcolormanager.h"
#include "colorcorrectadaptor.h"
#include "manager.h"
#include <QDBusMessage>
namespace KWin {
namespace ColorCorrect {
ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
NightColorDBusInterface::NightColorDBusInterface(NightColorManager *parent)
: QObject(parent)
, m_manager(parent)
, m_inhibitorWatcher(new QDBusServiceWatcher(this))
......@@ -25,9 +23,9 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
m_inhibitorWatcher->setConnection(QDBusConnection::sessionBus());
m_inhibitorWatcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
connect(m_inhibitorWatcher, &QDBusServiceWatcher::serviceUnregistered,
this, &ColorCorrectDBusInterface::removeInhibitorService);
this, &NightColorDBusInterface::removeInhibitorService);
connect(m_manager, &Manager::inhibitedChanged, this, [this] {
connect(m_manager, &NightColorManager::inhibitedChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("inhibited"), m_manager->isInhibited());
......@@ -46,7 +44,7 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::enabledChanged, this, [this] {
connect(m_manager, &NightColorManager::enabledChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("enabled"), m_manager->isEnabled());
......@@ -65,7 +63,7 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::runningChanged, this, [this] {
connect(m_manager, &NightColorManager::runningChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("running"), m_manager->isRunning());
......@@ -84,7 +82,7 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::currentTemperatureChanged, this, [this] {
connect(m_manager, &NightColorManager::currentTemperatureChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("currentTemperature"), m_manager->currentTemperature());
......@@ -103,7 +101,7 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::targetTemperatureChanged, this, [this] {
connect(m_manager, &NightColorManager::targetTemperatureChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("targetTemperature"), m_manager->targetTemperature());
......@@ -122,7 +120,7 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::modeChanged, this, [this] {
connect(m_manager, &NightColorManager::modeChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("mode"), uint(m_manager->mode()));
......@@ -141,7 +139,7 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::previousTransitionTimingsChanged, this, [this] {
connect(m_manager, &NightColorManager::previousTransitionTimingsChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("previousTransitionDateTime"), previousTransitionDateTime());
changedProperties.insert(QStringLiteral("previousTransitionDuration"), previousTransitionDuration());
......@@ -161,7 +159,7 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::scheduledTransitionTimingsChanged, this, [this] {
connect(m_manager, &NightColorManager::scheduledTransitionTimingsChanged, this, [this] {
QVariantMap changedProperties;
changedProperties.insert(QStringLiteral("scheduledTransitionDateTime"), scheduledTransitionDateTime());
changedProperties.insert(QStringLiteral("scheduledTransitionDuration"), scheduledTransitionDuration());
......@@ -181,47 +179,47 @@ ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent)
QDBusConnection::sessionBus().send(message);
});
connect(m_manager, &Manager::configChange, this, &ColorCorrectDBusInterface::nightColorConfigChanged);
connect(m_manager, &NightColorManager::configChange, this, &NightColorDBusInterface::nightColorConfigChanged);
new ColorCorrectAdaptor(this);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/ColorCorrect"), this);
}
bool ColorCorrectDBusInterface::isInhibited() const
bool NightColorDBusInterface::isInhibited() const
{
return m_manager->isInhibited();
}
bool ColorCorrectDBusInterface::isEnabled() const
bool NightColorDBusInterface::isEnabled() const
{
return m_manager->isEnabled();
}
bool ColorCorrectDBusInterface::isRunning() const
bool NightColorDBusInterface::isRunning() const
{
return m_manager->isRunning();
}
bool ColorCorrectDBusInterface::isAvailable() const
bool NightColorDBusInterface::isAvailable() const
{
return m_manager->isAvailable();
}
int ColorCorrectDBusInterface::currentTemperature() const
int NightColorDBusInterface::currentTemperature() const
{
return m_manager->currentTemperature();
}
int ColorCorrectDBusInterface::targetTemperature() const
int NightColorDBusInterface::targetTemperature() const
{
return m_manager->targetTemperature();
}
int ColorCorrectDBusInterface::mode() const
int NightColorDBusInterface::mode() const
{
return m_manager->mode();
}
quint64 ColorCorrectDBusInterface::previousTransitionDateTime() const
quint64 NightColorDBusInterface::previousTransitionDateTime() const
{
const QDateTime dateTime = m_manager->previousTransitionDateTime();
if (dateTime.isValid()) {
......@@ -230,12 +228,12 @@ quint64 ColorCorrectDBusInterface::previousTransitionDateTime() const
return 0;
}
quint32 ColorCorrectDBusInterface::previousTransitionDuration() const
quint32 NightColorDBusInterface::previousTransitionDuration() const
{
return quint32(m_manager->previousTransitionDuration());
}
quint64 ColorCorrectDBusInterface::scheduledTransitionDateTime() const
quint64 NightColorDBusInterface::scheduledTransitionDateTime() const
{
const QDateTime dateTime = m_manager->scheduledTransitionDateTime();
if (dateTime.isValid()) {
......@@ -244,27 +242,27 @@ quint64 ColorCorrectDBusInterface::scheduledTransitionDateTime() const
return 0;
}
quint32 ColorCorrectDBusInterface::scheduledTransitionDuration() const
quint32 NightColorDBusInterface::scheduledTransitionDuration() const
{
return quint32(m_manager->scheduledTransitionDuration());
}
QHash<QString, QVariant> ColorCorrectDBusInterface::nightColorInfo()
QHash<QString, QVariant> NightColorDBusInterface::nightColorInfo()
{
return m_manager->info();
}
bool ColorCorrectDBusInterface::setNightColorConfig(QHash<QString, QVariant> data)
bool NightColorDBusInterface::setNightColorConfig(QHash<QString, QVariant> data)
{
return m_manager->changeConfiguration(data);
}
void ColorCorrectDBusInterface::nightColorAutoLocationUpdate(double latitude, double longitude)
void NightColorDBusInterface::nightColorAutoLocationUpdate(double latitude, double longitude)
{
m_manager->autoLocationUpdate(latitude, longitude);
}
uint ColorCorrectDBusInterface::inhibit()
uint NightColorDBusInterface::inhibit()
{
const QString serviceName = QDBusContext::message().service();
......@@ -279,14 +277,14 @@ uint ColorCorrectDBusInterface::inhibit()
return m_lastInhibitionCookie;
}
void ColorCorrectDBusInterface::uninhibit(uint cookie)
void NightColorDBusInterface::uninhibit(uint cookie)
{
const QString serviceName = QDBusContext::message().service();
uninhibit(serviceName, cookie);
}
void ColorCorrectDBusInterface::uninhibit(const QString &serviceName, uint cookie)
void NightColorDBusInterface::uninhibit(const QString &serviceName, uint cookie)
{
const int removedCount = m_inhibitors.remove(serviceName, cookie);
if (!removedCount) {
......@@ -300,7 +298,7 @@ void ColorCorrectDBusInterface::uninhibit(const QString &serviceName, uint cooki
m_manager->uninhibit();
}
void ColorCorrectDBusInterface::removeInhibitorService(const QString &serviceName)
void NightColorDBusInterface::removeInhibitorService(const QString &serviceName)
{
const auto cookies = m_inhibitors.values(serviceName);
for (const uint &cookie : cookies) {
......@@ -309,4 +307,3 @@ void ColorCorrectDBusInterface::removeInhibitorService(const QString &serviceNam
}