diff options
author | Manuel Schneider | 2014-05-28 17:22:14 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-05-28 17:22:14 +0200 |
commit | 11e18ee79b54cb2bd9d95af785be3270931ff0d9 (patch) | |
tree | a851e427ab0065e167d945905cb5cc8a6f2612e6 /src/client/connectwindow/connectwindow.cpp | |
parent | Increase timeout for debugging (diff) | |
download | pvs2-11e18ee79b54cb2bd9d95af785be3270931ff0d9.tar.gz pvs2-11e18ee79b54cb2bd9d95af785be3270931ff0d9.tar.xz pvs2-11e18ee79b54cb2bd9d95af785be3270931ff0d9.zip |
Try to reconnect if the pvsmgr gets disconnected
Diffstat (limited to 'src/client/connectwindow/connectwindow.cpp')
-rw-r--r-- | src/client/connectwindow/connectwindow.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/connectwindow/connectwindow.cpp b/src/client/connectwindow/connectwindow.cpp index 34087ad..7f24281 100644 --- a/src/client/connectwindow/connectwindow.cpp +++ b/src/client/connectwindow/connectwindow.cpp @@ -164,7 +164,7 @@ void ConnectWindow::connectToSession(const QByteArray sessionName) return; _state = Scanning; this->updateState(); - _serverDiscovery.start(_ui->lineEditName->text().toUtf8()); + _serverDiscovery.start(sessionName); } /* @@ -189,6 +189,7 @@ void ConnectWindow::onBtnConnection() if (_connected || _state != Idle) { + _tryReconnect = false; // Stop or disconnect emit disconnect(); _state = Idle; @@ -197,6 +198,7 @@ void ConnectWindow::onBtnConnection() else { // Connect (scan for session) + _tryReconnect = true; connectToSession(_ui->lineEditName->text().toUtf8()); } } @@ -233,6 +235,7 @@ void ConnectWindow::onServerDetected(const QString& host, const quint16 port, co */ void ConnectWindow::onConnectionStateChange(ConnectWindow::ConnectionState state) { + qDebug() << "STATE!"<< state; bool reset = (_state == Scanning); if (state == InvalidSslHash) ++_hashSslErrorCount; @@ -240,8 +243,10 @@ void ConnectWindow::onConnectionStateChange(ConnectWindow::ConnectionState state _state = state; this->updateState(); - if (reset) + if (reset) { + qDebug() << "RESET!!"<< state; _state = Scanning; + } if (state == Connected) { QObject::disconnect(_connection, SIGNAL(stateChange(ConnectWindow::ConnectionState)), this, SLOT(onConnectionStateChange(ConnectWindow::ConnectionState))); @@ -271,5 +276,8 @@ void ConnectWindow::onConnectionClosed(QObject* connection) void ConnectWindow::onConnectionDisconnected() { _connected = false; + _state = Idle; this->updateState(); + if (_tryReconnect) + connectToSession(_ui->lineEditName->text().toUtf8()); } |