diff options
author | kh <karsten.heimrich@theqtcompany.com> | 2014-11-27 14:30:56 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2014-12-02 13:28:42 +0100 |
commit | d872d37e840d63d338ece1eb684aa9cd4b0d9fbc (patch) | |
tree | 58bfcdc1572c20ccbfea00e51e29d38fbd1b4086 /src/libs/installer/remoteclient_p.h | |
parent | 02698bfb3d6e2a0b403c360805c40605263d80f2 (diff) |
Move the KeepAliveObject class into its own source files.
Change-Id: Iaf8f397bdcaa4afb5432b826aa3fe238d54193c0
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/remoteclient_p.h')
-rw-r--r-- | src/libs/installer/remoteclient_p.h | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/src/libs/installer/remoteclient_p.h b/src/libs/installer/remoteclient_p.h index 6c1d41951..23dcc9c14 100644 --- a/src/libs/installer/remoteclient_p.h +++ b/src/libs/installer/remoteclient_p.h @@ -36,6 +36,7 @@ #define REMOTECLIENT_P_H #include "adminauthorization.h" +#include "keepaliveobject.h" #include "messageboxhandler.h" #include "protocol.h" #include "remoteclient.h" @@ -51,59 +52,6 @@ namespace QInstaller { -class KeepAliveObject : public QObject -{ - Q_OBJECT - Q_DISABLE_COPY(KeepAliveObject) - -public: - KeepAliveObject() - : m_timer(0) - , m_quit(false) - { - } - -public slots: - void start() - { - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(onTimeout())); - m_timer->start(5000); - } - - void finish() - { - m_quit = true; - } - -private slots: - void onTimeout() - { - m_timer->stop(); - { - // Try to connect to the privileged running server. If we succeed the server side - // watchdog gets restarted and the server keeps running for another 30 seconds. - QTcpSocket socket; - socket.connectToHost(RemoteClient::instance().address(), - RemoteClient::instance().port()); - - QElapsedTimer stopWatch; - stopWatch.start(); - while ((socket.state() == QAbstractSocket::ConnectingState) - && (stopWatch.elapsed() < 10000) && (!m_quit)) { - if ((stopWatch.elapsed() % 2500) == 0) - QCoreApplication::processEvents(); - } - } - if (!m_quit) - m_timer->start(5000); - } - -private: - QTimer *m_timer; - volatile bool m_quit; -}; - class RemoteClientPrivate { Q_DECLARE_PUBLIC(RemoteClient) |