From c0d724b53872cc702b4cac2a6bab209083f1b3dd Mon Sep 17 00:00:00 2001 From: Andrey Butirsky Date: Sun, 10 Jan 2021 23:46:44 +0300 Subject: [PATCH] fix: Clazy detached QVector warning [clazy-range-loop] warning: c++11 range-loop might detach Qt container (QVector) [clazy- range-loop] --- keyboard_layout_switching.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboard_layout_switching.cpp b/keyboard_layout_switching.cpp index 0f9034691b..081e9e22e7 100644 --- a/keyboard_layout_switching.cpp +++ b/keyboard_layout_switching.cpp @@ -126,7 +126,8 @@ VirtualDesktopPolicy::VirtualDesktopPolicy(Xkb *xkb, KeyboardLayout *layout, con [this, xkb] (const QString &name) { Q_UNUSED(name) if (xkb->numberOfLayouts() > 1) { - for (KWin::VirtualDesktop* const desktop : VirtualDesktopManager::self()->desktops()) { + const auto &desktops = VirtualDesktopManager::self()->desktops(); + for (KWin::VirtualDesktop* const desktop : desktops) { const uint layout = m_config.readEntry( defaultLayoutEntryKey() % QLatin1String( QByteArray::number(desktop->x11DesktopNumber()) ),