summaryrefslogtreecommitdiffstats
path: root/src/server/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/net')
-rw-r--r--src/server/net/client.cpp17
-rw-r--r--src/server/net/client.h4
2 files changed, 10 insertions, 11 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
diff --git a/src/server/net/client.h b/src/server/net/client.h
index 885d4fc..32237bf 100644
--- a/src/server/net/client.h
+++ b/src/server/net/client.h
@@ -54,7 +54,7 @@ public:
void startVncClient(Client const * const to );
void stopVncClient();
void lockScreen(bool);
- void requestThumb(const int width, const int height);
+ void requestThumb(const QSize& size);
private:
@@ -93,7 +93,7 @@ protected:
signals:
void authenticating(Client* client, ClientLogin* request);
void authenticated(Client* client);
- void thumbUpdated(Client* client, const QPixmap& thumb, const QByteArray& rawImage);
+ void thumbUpdated(Client* client, const QImage& thumb);
void vncServerStateChange(Client* client);
void vncClientStateChange(Client* client);
void stateChanged();