summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/vnc/qvnc.cpp
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2018-12-05 19:48:05 +0000
committerSérgio Martins <sergio.martins@kdab.com>2018-12-10 11:47:28 +0000
commit3464e1e5c7b5b01ae13c99e3529dd02af1d36958 (patch)
treec64654aa734d71add2df23872fa77113193e6d0e /src/plugins/platforms/vnc/qvnc.cpp
parentfc85a6b6b952aa619b87262d4187dc05865ab51a (diff)
Add a few qAsConst() to range-for to prevent detachments
places indicated by clazy As a drive-by, fixed minor styling issues in the affected lines. Change-Id: I88d3fc0c8573cde0e61f19a18dd9ea697ee40c34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/vnc/qvnc.cpp')
-rw-r--r--src/plugins/platforms/vnc/qvnc.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/platforms/vnc/qvnc.cpp b/src/plugins/platforms/vnc/qvnc.cpp
index ffe00de2b1..32114c6443 100644
--- a/src/plugins/platforms/vnc/qvnc.cpp
+++ b/src/plugins/platforms/vnc/qvnc.cpp
@@ -600,7 +600,7 @@ void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window)
cursor = *platformImage.image();
hotspot = platformImage.hotspot();
}
- for (auto client : clients)
+ for (auto client : qAsConst(clients))
client->setDirtyCursor();
}
@@ -638,16 +638,14 @@ void QVncServer::init()
QVncServer::~QVncServer()
{
- for (auto client : clients) {
- delete client;
- }
+ qDeleteAll(clients);
}
void QVncServer::setDirty()
{
- for (auto client : clients) {
+ for (auto client : qAsConst(clients))
client->setDirty(qvnc_screen->dirtyRegion);
- }
+
qvnc_screen->clearDirty();
}