summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbscreen.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-26 14:38:54 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-04-26 13:28:28 +0000
commit40e4f75786228041c0bb9ab21268589d6dc75985 (patch)
tree486de789dda0ee061ecc13499b4f44462041a4b4 /src/plugins/platforms/xcb/qxcbscreen.cpp
parentee2e441018aa390de1edfdc03909272771e4835c (diff)
xcb: eradicate Q_FOREACH loops [rvalues]
... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I982851f15868e62b7a191676ddf4ba6b92c0a42d Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 4cb1b29152..b4c772dd3b 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -76,7 +76,8 @@ QXcbVirtualDesktop::~QXcbVirtualDesktop()
QXcbScreen *QXcbVirtualDesktop::screenAt(const QPoint &pos) const
{
- foreach (QXcbScreen *screen, connection()->screens()) {
+ const auto screens = connection()->screens();
+ for (QXcbScreen *screen : screens) {
if (screen->virtualDesktop() == this && screen->geometry().contains(pos))
return screen;
}