summaryrefslogtreecommitdiffstats
path: root/src/client/connectwindow/connectwindow.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-11-28 13:04:02 +0100
committerManuel Schneider2014-11-28 13:04:02 +0100
commitc4ab9a22010e22180718745dc2fd985ee46b5590 (patch)
tree99facf204f6e139ead7f387a02fcbbbc7dd01f7a /src/client/connectwindow/connectwindow.cpp
parentChange confusing membername (diff)
downloadpvs2-c4ab9a22010e22180718745dc2fd985ee46b5590.tar.gz
pvs2-c4ab9a22010e22180718745dc2fd985ee46b5590.tar.xz
pvs2-c4ab9a22010e22180718745dc2fd985ee46b5590.zip
Remove redundant flags
Diffstat (limited to 'src/client/connectwindow/connectwindow.cpp')
-rw-r--r--src/client/connectwindow/connectwindow.cpp11
1 files changed, 4 insertions, 7 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)