summaryrefslogtreecommitdiffstats
path: root/src/server/net/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/net/client.cpp')
-rw-r--r--src/server/net/client.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp
index 0dd8783..c11cb63 100644
--- a/src/server/net/client.cpp
+++ b/src/server/net/client.cpp
@@ -104,7 +104,7 @@ void Client::removeAttentionInternal()
}
/******************************************************************************/
-void Client::requestThumb(const int width, const int height)
+void Client::requestThumb(const QSize& size)
{
if (_socket->state() != QAbstractSocket::ConnectedState) {
qDebug("requestThumb called in bad state");
@@ -112,8 +112,8 @@ void Client::requestThumb(const int width, const int height)
}
NetworkMessage msgTmb;
msgTmb.setField(_ID, _THUMB);
- msgTmb.setField(_X, QString::number(width));
- msgTmb.setField(_Y, QString::number(height));
+ msgTmb.setField(_X, QString::number(size.width()));
+ msgTmb.setField(_Y, QString::number(size.height()));
msgTmb.writeMessage(_socket);
}
@@ -154,16 +154,15 @@ void Client::handleMsg()
if (_authed == 2) {
// Following messages are only valid of the client is already authenticated
if (id == _THUMB) {
- QPixmap pixmap;
- const QByteArray& rawImage = _fromClient.getFieldBytes("IMG");
+ QImage image;
+ _rawRemoteScreen = _fromClient.getFieldBytes("IMG");
/* size 0 means the client is in exam-mode and therefore doesn't send any thumbnail */
- if (rawImage.size() > 0) {
- if (!pixmap.loadFromData(rawImage)) {
+ if (_rawRemoteScreen.size() > 0) {
+ if (!image.loadFromData(_rawRemoteScreen)) {
qDebug("Could not decode thumbnail image from client.");
return;
}
- _rawRemoteScreen = QByteArray(rawImage);
- emit thumbUpdated(this, pixmap, rawImage);
+ emit thumbUpdated(this, image);
}
} else if (id == _VNCSERVER) {
// Client tells about startup of vnc server