diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp index 4a6009eb3..6d0c58ca8 100644 --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -1131,11 +1131,9 @@ PanelView *ShellCorona::panelView(Plasma::Containment *containment) const QList ShellCorona::panelsForScreen(QScreen *screen) const { QList ret; - for (PanelView *v : m_panelViews) { - if (v->screenToFollow() == screen) { - ret += v; - } - } + std::copy_if(m_panelViews.cbegin(), m_panelViews.cend(), std::back_inserter(ret), [screen](const PanelView *v) { + return v->screenToFollow() == screen; + }); return ret; }