From e8fada8a36c480711717cd68980f5778c44683dc Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Wed, 28 Aug 2019 22:58:21 +0200 Subject: [PATCH] Get name and refresh rate from output device Summary: We can simplify the AbstractWaylandOutput code some more by getting name and refresh rate of an output from the always available output device object. Test Plan: Tested with DRM, Wayland nested and virtual backends. Reviewers: #kwin Subscribers: davidedmundson, apol, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D23546 --- abstract_wayland_output.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/abstract_wayland_output.cpp b/abstract_wayland_output.cpp index db32e8b6c4..2fc3872045 100644 --- a/abstract_wayland_output.cpp +++ b/abstract_wayland_output.cpp @@ -46,10 +46,8 @@ AbstractWaylandOutput::~AbstractWaylandOutput() QString AbstractWaylandOutput::name() const { - if (!m_waylandOutput) { - return i18n("unknown"); - } - return QStringLiteral("%1 %2").arg(m_waylandOutput->manufacturer()).arg(m_waylandOutput->model()); + return QStringLiteral("%1 %2").arg(m_waylandOutputDevice->manufacturer()).arg( + m_waylandOutputDevice->model()); } QRect AbstractWaylandOutput::geometry() const @@ -64,10 +62,7 @@ QSize AbstractWaylandOutput::physicalSize() const int AbstractWaylandOutput::refreshRate() const { - if (!m_waylandOutput) { - return 60000; - } - return m_waylandOutput->refreshRate(); + return m_waylandOutputDevice->refreshRate(); } QPoint AbstractWaylandOutput::globalPos() const