diff options
author | Manuel Schneider | 2014-11-28 13:04:02 +0100 |
---|---|---|
committer | Manuel Schneider | 2014-11-28 13:04:02 +0100 |
commit | c4ab9a22010e22180718745dc2fd985ee46b5590 (patch) | |
tree | 99facf204f6e139ead7f387a02fcbbbc7dd01f7a /src/client | |
parent | Change confusing membername (diff) | |
download | pvs2-c4ab9a22010e22180718745dc2fd985ee46b5590.tar.gz pvs2-c4ab9a22010e22180718745dc2fd985ee46b5590.tar.xz pvs2-c4ab9a22010e22180718745dc2fd985ee46b5590.zip |
Remove redundant flags
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/connectwindow/connectwindow.cpp | 11 | ||||
-rw-r--r-- | src/client/connectwindow/connectwindow.h | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/client/connectwindow/connectwindow.cpp b/src/client/connectwindow/connectwindow.cpp index 4a57532..6f75e29 100644 --- a/src/client/connectwindow/connectwindow.cpp +++ b/src/client/connectwindow/connectwindow.cpp @@ -23,7 +23,6 @@ ConnectWindow::ConnectWindow(QWidget *parent) : QWidget(parent) { _ui = new Ui::ConnectWindow; - _connected = false; _timerHide = 0; _connection = NULL; _state = Idle; @@ -62,9 +61,9 @@ ConnectWindow::~ConnectWindow(){} */ void ConnectWindow::updateUserInterface() { - _ui->lineEditName->setEnabled(_state == Idle && !_connected); + _ui->lineEditName->setEnabled(_state == Idle); - if (_connected) + if (_state == Connected) { _ui->btn_connection->setEnabled(true); _ui->btn_connection->setText(tr("&Disconnect")); @@ -160,7 +159,7 @@ void ConnectWindow::showEvent(QShowEvent* event) */ void ConnectWindow::connectToSession(const QByteArray sessionName, QString mgrIP) { - if (_connected || _state != Idle) + if (_state != Idle) return; _state = Scanning; this->updateUserInterface(); @@ -187,7 +186,7 @@ void ConnectWindow::onBtnConnection() if (_serverDiscovery.isActive()) _serverDiscovery.stop(); - if (_connected || _state != Idle) + if (_state != Idle) { _tryReconnect = false; // Stop or disconnect @@ -254,7 +253,6 @@ void ConnectWindow::onConnectionStateChange(ConnectWindow::ConnectionState state QObject::disconnect(_connection, SIGNAL(destroyed(QObject*)), this, SLOT(onConnectionClosed(QObject*))); emit connected(_connection); - _connected = true; this->updateUserInterface(); _connection = NULL; @@ -276,7 +274,6 @@ void ConnectWindow::onConnectionClosed(QObject* connection) */ void ConnectWindow::onConnectionDisconnected() { - _connected = false; _state = Idle; this->updateUserInterface(); if (_tryReconnect) diff --git a/src/client/connectwindow/connectwindow.h b/src/client/connectwindow/connectwindow.h index 02d690f..92d0a4c 100644 --- a/src/client/connectwindow/connectwindow.h +++ b/src/client/connectwindow/connectwindow.h @@ -64,7 +64,7 @@ private: ConnectionState _state; QByteArray _sessionNameBytes; NetworkMessage _packet; - bool _connected, _tryReconnect; + bool _tryReconnect; int _timerHide; void updateUserInterface(); |