From 9882118cf4f17a854859c1d1364fa16e7da8bddb Mon Sep 17 00:00:00 2001 From: allexzander Date: Thu, 15 Jul 2021 10:53:31 +0300 Subject: [PATCH] Remove request to config for userVisibleURL. Signed-off-by: allexzander --- src/gui/connectionvalidator.cpp | 22 ---------------------- src/gui/connectionvalidator.h | 4 +--- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/gui/connectionvalidator.cpp b/src/gui/connectionvalidator.cpp index f799cd662203c..159333544c45b 100644 --- a/src/gui/connectionvalidator.cpp +++ b/src/gui/connectionvalidator.cpp @@ -227,17 +227,6 @@ void ConnectionValidator::checkServerCapabilities() job->setTimeout(timeoutToUseMsec); QObject::connect(job, &JsonApiJob::jsonReceived, this, &ConnectionValidator::slotCapabilitiesRecieved); job->start(); - - // And we'll retrieve the ocs config in parallel - // note that 'this' might be destroyed before the job finishes, so intentionally not parented - auto configJob = new JsonApiJob(_account, QLatin1String("ocs/v1.php/config")); - configJob->setTimeout(timeoutToUseMsec); - auto account = _account; // capturing account by value will make it live long enough - QObject::connect(configJob, &JsonApiJob::jsonReceived, _account.data(), - [=](const QJsonDocument &json) { - ocsConfigReceived(json, account); - }); - configJob->start(); } void ConnectionValidator::slotCapabilitiesRecieved(const QJsonDocument &json) @@ -260,17 +249,6 @@ void ConnectionValidator::slotCapabilitiesRecieved(const QJsonDocument &json) fetchUser(); } -void ConnectionValidator::ocsConfigReceived(const QJsonDocument &json, AccountPtr account) -{ - QString host = json.object().value("ocs").toObject().value("data").toObject().value("host").toString(); - if (host.isEmpty()) { - qCWarning(lcConnectionValidator) << "Could not extract 'host' from ocs config reply"; - return; - } - qCInfo(lcConnectionValidator) << "Determined user-visible host to be" << host; - account->setUserVisibleHost(host); -} - void ConnectionValidator::fetchUser() { auto *userInfo = new UserInfo(_accountState.data(), true, true, this); diff --git a/src/gui/connectionvalidator.h b/src/gui/connectionvalidator.h index 3ac94771a1ccf..7915c654c3220 100644 --- a/src/gui/connectionvalidator.h +++ b/src/gui/connectionvalidator.h @@ -60,8 +60,7 @@ namespace OCC { +---------------------------+ | +-> checkServerCapabilities --------------v (in parallel) - JsonApiJob (cloud/capabilities) JsonApiJob (ocs/v1.php/config) - | +-> ocsConfigReceived + JsonApiJob (cloud/capabilities) +-> slotCapabilitiesRecieved -+ | +---------------------------------+ @@ -131,7 +130,6 @@ protected slots: void reportResult(Status status); void checkServerCapabilities(); void fetchUser(); - static void ocsConfigReceived(const QJsonDocument &json, AccountPtr account); /** Sets the account's server version *