From 888c835e6bbd39e13c9effd50e13ae3a852b25b7 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 21 Jun 2024 16:08:36 +0200 Subject: [PATCH] WIP --- src/gui/accountsettings.cpp | 4 ++-- src/gui/networkinformation.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 46b7f4e2732..d64e63902fc 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -458,7 +458,7 @@ void AccountSettings::slotAccountStateChanged() { const AccountState::State state = _accountState->state(); const AccountPtr account = _accountState->account(); - +qDebug()<<"*** account state changed to"<url().adjusted(QUrl::RemoveUserInfo); @@ -495,7 +495,7 @@ void AccountSettings::slotAccountStateChanged() case AccountState::Connecting: if (NetworkInformation::instance()->isBehindCaptivePortal()) { showConnectionLabel(tr("Captive portal prevents connections to %1.").arg(server)); - } else if (NetworkInformation::instance()->isMetered()) { + } else if (NetworkInformation::instance()->isMetered() && ConfigFile().pauseSyncWhenMetered()) { showConnectionLabel(tr("Sync to %1 is paused due to metered internet connection.").arg(server)); } else { showConnectionLabel(tr("Connecting to: %1.").arg(server)); diff --git a/src/gui/networkinformation.cpp b/src/gui/networkinformation.cpp index a4243d6da64..5f03dbd3b8f 100644 --- a/src/gui/networkinformation.cpp +++ b/src/gui/networkinformation.cpp @@ -42,7 +42,7 @@ void loadQNetworkInformationBackend() qCDebug(lcNetInfo) << "Available backends:" << QNetworkInformation::availableBackends().join(QStringLiteral(", ")); if (auto qni = QNetworkInformation::instance()) { QObject::connect(qni, &QNetworkInformation::reachabilityChanged, - [](QNetworkInformation::Reachability reachability) { qCInfo(lcNetInfo) << "Connection Status changed to:" << reachability; }); + [qni](QNetworkInformation::Reachability reachability) { qCInfo(lcNetInfo) << "Connection Status changed to:" << reachability << "captive portal status:" << qni->isBehindCaptivePortal(); }); } } @@ -123,6 +123,8 @@ bool NetworkInformation::isBehindCaptivePortal() const void NetworkInformation::slotIsBehindCaptivePortalChanged(bool state) { + qCDebug(lcNetInfo) << "OS signals behind captive portal changed to" << state << "forced captive portal flag:" << _forcedCaptivePortal; + if (!_forcedCaptivePortal) { Q_EMIT isBehindCaptivePortalChanged(state); }