From db9d7a7f5d9c7094418ec8f45ff19e0e620396b1 Mon Sep 17 00:00:00 2001 From: Cyril Rossi Date: Wed, 22 Apr 2020 18:32:30 +0200 Subject: [PATCH] KCM KWinScreenEdge fix build issue Summary: Remove Q_ASSERT() and add a None value to Monitor::Edge enum to convert ElectricBorder NONE or COUNT Test Plan: Fix kwin build Reviewers: #kwin, ngraham, zzag Reviewed By: #kwin, ngraham, zzag Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D29104 --- kcmkwin/kwinscreenedges/kwinscreenedge.cpp | 2 +- kcmkwin/kwinscreenedges/kwinscreenedge.h | 2 +- kcmkwin/kwinscreenedges/monitor.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kcmkwin/kwinscreenedges/kwinscreenedge.cpp b/kcmkwin/kwinscreenedges/kwinscreenedge.cpp index b12d9e4525..58cd3cccd6 100644 --- a/kcmkwin/kwinscreenedges/kwinscreenedge.cpp +++ b/kcmkwin/kwinscreenedges/kwinscreenedge.cpp @@ -168,7 +168,7 @@ int KWinScreenEdge::electricBorderToMonitorEdge(ElectricBorder border) case ElectricTopLeft: return Monitor::TopLeft; default: // ELECTRIC_COUNT and ElectricNone - Q_ASSERT(false); + return Monitor::None; } } diff --git a/kcmkwin/kwinscreenedges/kwinscreenedge.h b/kcmkwin/kwinscreenedges/kwinscreenedge.h index 5c9e65a147..350324cf7b 100644 --- a/kcmkwin/kwinscreenedges/kwinscreenedge.h +++ b/kcmkwin/kwinscreenedges/kwinscreenedge.h @@ -72,7 +72,7 @@ private: virtual bool isSaveNeeded() const; virtual bool isDefault() const; - // internal use, assert if border equals ELECTRIC_COUNT or ElectricNone + // internal use, return Monitor::None if border equals ELECTRIC_COUNT or ElectricNone static int electricBorderToMonitorEdge(ElectricBorder border); static ElectricBorder monitorEdgeToElectricBorder(int edge); diff --git a/kcmkwin/kwinscreenedges/monitor.h b/kcmkwin/kwinscreenedges/monitor.h index 2188cca149..3fb8b3e8d5 100644 --- a/kcmkwin/kwinscreenedges/monitor.h +++ b/kcmkwin/kwinscreenedges/monitor.h @@ -67,7 +67,8 @@ public: TopLeft, TopRight, BottomLeft, - BottomRight + BottomRight, + None }; Q_SIGNALS: void changed();