mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
use two different signals for settings success and failure
This commit is contained in:
parent
9a7267a10c
commit
85b8449e83
3 changed files with 6 additions and 4 deletions
|
@ -415,7 +415,8 @@ void AudioMixer::run() {
|
|||
|
||||
// block until we get the settingsRequestComplete signal
|
||||
QEventLoop loop;
|
||||
connect(&domainHandler, &DomainHandler::settingsRequestComplete, &loop, &QEventLoop::quit);
|
||||
connect(&domainHandler, &DomainHandler::settingsReceived, &loop, &QEventLoop::quit);
|
||||
connect(&domainHandler, &DomainHandler::settingsReceiveFail, &loop, &QEventLoop::quit);
|
||||
domainHandler.requestDomainSettings();
|
||||
loop.exec();
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ void DomainHandler::settingsRequestFinished() {
|
|||
_settingsObject = QJsonDocument::fromJson(settingsReply->readAll()).object();
|
||||
|
||||
qDebug() << "Received domain settings.";
|
||||
emit settingsRequestComplete(true);
|
||||
emit settingsReceived();
|
||||
|
||||
// reset failed settings requests to 0, we got them
|
||||
_failedSettingsRequests = 0;
|
||||
|
@ -170,7 +170,7 @@ void DomainHandler::settingsRequestFinished() {
|
|||
qDebug() << "Failed to retreive domain-server settings" << MAX_SETTINGS_REQUEST_FAILED_ATTEMPTS << "times. Re-setting connection to domain.";
|
||||
clearSettings();
|
||||
clearConnectionInfo();
|
||||
emit settingsRequestComplete(false);
|
||||
emit settingsReceiveFail();
|
||||
} else {
|
||||
requestDomainSettings();
|
||||
}
|
||||
|
|
|
@ -69,7 +69,8 @@ signals:
|
|||
void hostnameChanged(const QString& hostname);
|
||||
void connectedToDomain(const QString& hostname);
|
||||
|
||||
void settingsRequestComplete(bool wasSuccessful);
|
||||
void settingsReceived();
|
||||
void settingsReceiveFail();
|
||||
|
||||
private:
|
||||
void reset();
|
||||
|
|
Loading…
Reference in a new issue