From 5934e8ee931f6650189e3e86319f6d6e52cb6da0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 17 May 2019 11:22:27 +0200 Subject: QWaylandXdgShellV5: make xdgSurfaceFromSurface() const-correct ... and replace a Q_FOREACH with a C++11 ranged-for loop. Change-Id: I0e77bc51a53c5141217465152be1913539da0968 Reviewed-by: Johan Helsing --- src/compositor/extensions/qwaylandxdgshellv5.cpp | 4 ++-- src/compositor/extensions/qwaylandxdgshellv5_p.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index 0628f55e7..a85efbc5f 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -115,9 +115,9 @@ QWaylandXdgPopupV5 *QWaylandXdgShellV5Private::topmostPopupForClient(wl_client * return clientPopups.empty() ? nullptr : clientPopups.last(); } -QWaylandXdgSurfaceV5 *QWaylandXdgShellV5Private::xdgSurfaceFromSurface(QWaylandSurface *surface) +QWaylandXdgSurfaceV5 *QWaylandXdgShellV5Private::xdgSurfaceFromSurface(QWaylandSurface *surface) const { - Q_FOREACH (QWaylandXdgSurfaceV5 *xdgSurface, m_xdgSurfaces) { + for (QWaylandXdgSurfaceV5 *xdgSurface : m_xdgSurfaces) { if (surface == xdgSurface->surface()) return xdgSurface; } diff --git a/src/compositor/extensions/qwaylandxdgshellv5_p.h b/src/compositor/extensions/qwaylandxdgshellv5_p.h index 8f5af746b..d10359e68 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv5_p.h @@ -81,7 +81,7 @@ public: QMultiMap m_xdgSurfaces; QMultiMap m_xdgPopups; - QWaylandXdgSurfaceV5 *xdgSurfaceFromSurface(QWaylandSurface *surface); + QWaylandXdgSurfaceV5 *xdgSurfaceFromSurface(QWaylandSurface *surface) const; protected: void xdg_shell_destroy(Resource *resource) override; -- cgit v1.2.3