diff options
Diffstat (limited to 'src/plugins/platforms/vnc/qvnc.cpp')
-rw-r--r-- | src/plugins/platforms/vnc/qvnc.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/platforms/vnc/qvnc.cpp b/src/plugins/platforms/vnc/qvnc.cpp index d09c6789b7..99e80e5801 100644 --- a/src/plugins/platforms/vnc/qvnc.cpp +++ b/src/plugins/platforms/vnc/qvnc.cpp @@ -567,7 +567,7 @@ void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window) cursor = *platformImage.image(); hotspot = platformImage.hotspot(); } - for (auto client : qAsConst(clients)) + for (auto client : std::as_const(clients)) client->setDirtyCursor(); } @@ -583,7 +583,7 @@ void QVncClientCursor::addClient(QVncClient *client) uint QVncClientCursor::removeClient(QVncClient *client) { clients.removeOne(client); - return clients.count(); + return clients.size(); } #endif // QT_CONFIG(cursor) @@ -613,7 +613,7 @@ QVncServer::~QVncServer() void QVncServer::setDirty() { - for (auto client : qAsConst(clients)) + for (auto client : std::as_const(clients)) client->setDirty(qvnc_screen->dirtyRegion); qvnc_screen->clearDirty(); @@ -635,11 +635,10 @@ void QVncServer::newConnection() void QVncServer::discardClient(QVncClient *client) { clients.removeOne(client); + qvnc_screen->disableClientCursor(client); client->deleteLater(); - if (clients.isEmpty()) { - qvnc_screen->disableClientCursor(client); + if (clients.isEmpty()) qvnc_screen->setPowerState(QPlatformScreen::PowerStateOff); - } } inline QImage QVncServer::screenImage() const |