Screenshot effect: Convert a couple foreach loops

This commit is contained in:
Méven Car 2020-08-19 14:56:19 +02:00 committed by Méven Car
parent fb118a9343
commit 571ca776c3

View file

@ -241,7 +241,7 @@ void ScreenShotEffect::postPaintScreen()
double right = m_scheduledScreenshot->width(); double right = m_scheduledScreenshot->width();
double bottom = m_scheduledScreenshot->height(); double bottom = m_scheduledScreenshot->height();
if (m_scheduledScreenshot->hasDecoration() && m_type & INCLUDE_DECORATION) { if (m_scheduledScreenshot->hasDecoration() && m_type & INCLUDE_DECORATION) {
foreach (const WindowQuad & quad, d.quads) { for (const WindowQuad &quad : qAsConst(d.quads)) {
// we need this loop to include the decoration padding // we need this loop to include the decoration padding
left = qMin(left, quad.left()); left = qMin(left, quad.left());
top = qMin(top, quad.top()); top = qMin(top, quad.top());
@ -254,7 +254,7 @@ void ScreenShotEffect::postPaintScreen()
top = m_scheduledScreenshot->height(); top = m_scheduledScreenshot->height();
right = 0; right = 0;
bottom = 0; bottom = 0;
foreach (const WindowQuad & quad, d.quads) { for (const WindowQuad &quad : qAsConst(d.quads)) {
if (quad.type() == WindowQuadContents) { if (quad.type() == WindowQuadContents) {
newQuads << quad; newQuads << quad;
left = qMin(left, quad.left()); left = qMin(left, quad.left());