AccountState: Run only a single validator, allow error message overriding #3236 #3153

This commit is contained in:
Markus Goetz 2015-05-15 12:26:23 +02:00
parent d6dbabfbc4
commit 06c889630c
2 changed files with 10 additions and 2 deletions

View file

@ -114,9 +114,10 @@ void AccountState::setState(State state)
} else if (oldState == SignedOut && _state == Disconnected) {
checkConnectivity();
}
emit stateChanged(_state);
}
// might not have changed but the underlying _connectionErrors might have
emit stateChanged(_state);
}
QString AccountState::stateString(State state)
@ -174,7 +175,12 @@ void AccountState::checkConnectivity()
return;
}
if (_connectionValidator) {
qDebug() << "ConnectionValidator already running, ignoring";
return;
}
ConnectionValidator * conValidator = new ConnectionValidator(account());
_connectionValidator = conValidator;
connect(conValidator, SIGNAL(connectionResult(ConnectionValidator::Status,QStringList)),
SLOT(slotConnectionValidatorResult(ConnectionValidator::Status,QStringList)));
if (isConnected()) {

View file

@ -16,6 +16,7 @@
#define ACCOUNTINFO_H
#include <QByteArray>
#include <QPointer>
#include "utility.h"
#include "connectionvalidator.h"
@ -128,6 +129,7 @@ private:
ConnectionStatus _connectionStatus;
QStringList _connectionErrors;
bool _waitingForNewCredentials;
QPointer<ConnectionValidator> _connectionValidator;
};
}