summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/network/kernel/qnetworkinformation.cpp9
-rw-r--r--src/network/kernel/qnetworkinformation_p.h12
2 files changed, 10 insertions, 11 deletions
diff --git a/src/network/kernel/qnetworkinformation.cpp b/src/network/kernel/qnetworkinformation.cpp
index 4f0b1405ef..3bfe623885 100644
--- a/src/network/kernel/qnetworkinformation.cpp
+++ b/src/network/kernel/qnetworkinformation.cpp
@@ -511,12 +511,11 @@ QNetworkInformation::QNetworkInformation(QNetworkInformationBackend *backend)
: QObject(*(new QNetworkInformationPrivate(backend)))
{
connect(backend, &QNetworkInformationBackend::reachabilityChanged, this,
- [this]() { emit reachabilityChanged(d_func()->backend->reachability()); });
- connect(backend, &QNetworkInformationBackend::behindCaptivePortalChanged, this, [this]() {
- emit isBehindCaptivePortalChanged(d_func()->backend->behindCaptivePortal());
- });
+ &QNetworkInformation::reachabilityChanged);
+ connect(backend, &QNetworkInformationBackend::behindCaptivePortalChanged, this,
+ &QNetworkInformation::isBehindCaptivePortalChanged);
connect(backend, &QNetworkInformationBackend::transportMediumChanged, this,
- [this]() { emit transportMediumChanged(d_func()->backend->transportMedium()); });
+ &QNetworkInformation::transportMediumChanged);
}
/*!
diff --git a/src/network/kernel/qnetworkinformation_p.h b/src/network/kernel/qnetworkinformation_p.h
index 971340b6e3..3493de3b44 100644
--- a/src/network/kernel/qnetworkinformation_p.h
+++ b/src/network/kernel/qnetworkinformation_p.h
@@ -89,16 +89,16 @@ public:
TransportMedium transportMedium() const { return m_transportMedium; }
Q_SIGNALS:
- void reachabilityChanged();
- void behindCaptivePortalChanged();
- void transportMediumChanged();
+ void reachabilityChanged(Reachability reachability);
+ void behindCaptivePortalChanged(bool behindPortal);
+ void transportMediumChanged(TransportMedium medium);
protected:
void setReachability(QNetworkInformation::Reachability reachability)
{
if (m_reachability != reachability) {
m_reachability = reachability;
- emit reachabilityChanged();
+ emit reachabilityChanged(reachability);
}
}
@@ -106,7 +106,7 @@ protected:
{
if (m_behindCaptivePortal != behindPortal) {
m_behindCaptivePortal = behindPortal;
- emit behindCaptivePortalChanged();
+ emit behindCaptivePortalChanged(behindPortal);
}
}
@@ -114,7 +114,7 @@ protected:
{
if (m_transportMedium != medium) {
m_transportMedium = medium;
- emit transportMediumChanged();
+ emit transportMediumChanged(medium);
}
}