fix: Clazy detached QVector warning [clazy-range-loop]

warning: c++11 range-loop might detach Qt container (QVector) [clazy-
range-loop]
This commit is contained in:
Andrey Butirsky 2021-01-10 23:46:44 +03:00
parent 071920418d
commit c0d724b538

View file

@ -126,7 +126,8 @@ VirtualDesktopPolicy::VirtualDesktopPolicy(Xkb *xkb, KeyboardLayout *layout, con
[this, xkb] (const QString &name) { [this, xkb] (const QString &name) {
Q_UNUSED(name) Q_UNUSED(name)
if (xkb->numberOfLayouts() > 1) { 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( const uint layout = m_config.readEntry(
defaultLayoutEntryKey() % defaultLayoutEntryKey() %
QLatin1String( QByteArray::number(desktop->x11DesktopNumber()) ), QLatin1String( QByteArray::number(desktop->x11DesktopNumber()) ),