summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/remoteserverconnection.cpp
diff options
context:
space:
mode:
authorkh <karsten.heimrich@theqtcompany.com>2014-11-26 14:39:17 +0100
committerKarsten Heimrich <karsten.heimrich@theqtcompany.com>2014-11-28 11:14:07 +0100
commit5b5ee638f65412bcff020c4e0869bc48edce0daa (patch)
tree857b3fe82a0671d5037a235799edfa4211e76177 /src/libs/installer/remoteserverconnection.cpp
parentafef6d5d5a67bc47023ee41173106568c154a1ce (diff)
Remove pointer, superfluous members. Use signals and slots.
Use signals and slots to tell about the shutdown request. Instead of passing around the server pointer, give the port and key as parameter. Change-Id: I0ad1667aa1caee4ffdee8b6951336f2254974810 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/remoteserverconnection.cpp')
-rw-r--r--src/libs/installer/remoteserverconnection.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libs/installer/remoteserverconnection.cpp b/src/libs/installer/remoteserverconnection.cpp
index 8619616bc..fbb51641c 100644
--- a/src/libs/installer/remoteserverconnection.cpp
+++ b/src/libs/installer/remoteserverconnection.cpp
@@ -36,7 +36,6 @@
#include "errors.h"
#include "protocol.h"
-#include "remoteserver.h"
#include "remoteserverconnection_p.h"
#include "utils.h"
@@ -45,12 +44,12 @@
namespace QInstaller {
-RemoteServerConnection::RemoteServerConnection(qintptr socketDescriptor, RemoteServer *parent)
+RemoteServerConnection::RemoteServerConnection(qintptr socketDescriptor, const QString &key)
: m_socketDescriptor(socketDescriptor)
, m_process(0)
, m_settings(0)
, m_engine(0)
- , m_server(parent)
+ , m_authorizationKey(key)
, m_signalReceiver(0)
{
}
@@ -77,13 +76,13 @@ void RemoteServerConnection::run()
if (authorized && command == QLatin1String(Protocol::Shutdown)) {
// this is a graceful shutdown
socket.close();
- if (m_server)
- m_server->deleteLater();
+ authorized = false;
+ emit shutdownRequested();
return;
} else if (command == QLatin1String(Protocol::Authorize)) {
QString key;
stream >> key;
- sendData(stream, (authorized = (m_server && (key == m_server->authorizationKey()))));
+ sendData(stream, (authorized = (key == m_authorizationKey)));
if (!authorized)
socket.close();
} else if (authorized) {