From 1fccb3daf1e5fa952ffa187ff005285852bde739 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 22 Jul 2022 11:16:10 +0300 Subject: [PATCH] plugins/colord-integration: Expose outputs managed by Workspace Workspace knows better about managed outputs, and it removes one more dependency on Platform::enabledOutputs() and the corresponding signals. --- .../colord-integration/colordintegration.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/plugins/colord-integration/colordintegration.cpp b/src/plugins/colord-integration/colordintegration.cpp index 853dd579b6..ee1fa6ee8f 100644 --- a/src/plugins/colord-integration/colordintegration.cpp +++ b/src/plugins/colord-integration/colordintegration.cpp @@ -7,9 +7,8 @@ #include "colordintegration.h" #include "colorddevice.h" #include "colordlogging.h" -#include "main.h" #include "output.h" -#include "platform.h" +#include "workspace.h" #include #include @@ -36,26 +35,22 @@ ColordIntegration::ColordIntegration() void ColordIntegration::initialize() { - const Platform *platform = kwinApp()->platform(); - m_colordInterface = new CdInterface(QStringLiteral("org.freedesktop.ColorManager"), QStringLiteral("/org/freedesktop/ColorManager"), QDBusConnection::systemBus(), this); - const QVector outputs = platform->outputs(); + const QList outputs = workspace()->outputs(); for (Output *output : outputs) { handleOutputAdded(output); } - connect(platform, &Platform::outputAdded, this, &ColordIntegration::handleOutputAdded); - connect(platform, &Platform::outputRemoved, this, &ColordIntegration::handleOutputRemoved); + connect(workspace(), &Workspace::outputAdded, this, &ColordIntegration::handleOutputAdded); + connect(workspace(), &Workspace::outputRemoved, this, &ColordIntegration::handleOutputRemoved); } void ColordIntegration::teardown() { - const Platform *platform = kwinApp()->platform(); - - const QVector outputs = platform->outputs(); + const QList outputs = workspace()->outputs(); for (Output *output : outputs) { handleOutputRemoved(output); } @@ -63,8 +58,8 @@ void ColordIntegration::teardown() delete m_colordInterface; m_colordInterface = nullptr; - disconnect(platform, &Platform::outputAdded, this, &ColordIntegration::handleOutputAdded); - disconnect(platform, &Platform::outputRemoved, this, &ColordIntegration::handleOutputRemoved); + disconnect(workspace(), &Workspace::outputAdded, this, &ColordIntegration::handleOutputAdded); + disconnect(workspace(), &Workspace::outputRemoved, this, &ColordIntegration::handleOutputRemoved); } void ColordIntegration::handleOutputAdded(Output *output)