diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2021-02-08 17:13:54 +0100 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2021-02-12 07:55:09 +0000 |
commit | 2983fe8f0900778a668bc4fdaf00d38ed299b6d8 (patch) | |
tree | 50e37723e3a5db0efa8d2e3fc957283b7f33adb3 /src/network | |
parent | 2c55e121c22601d365aa353cfa39ee856770855c (diff) |
QNetworkInformation fixups
Addressing feedback that came after the reviews
ended from both bot and people.
Added CLASS_NAME to the CMakeLists files for the plugins so that
cmake can generate the correct import.
Fixes: QTBUG-91061
Change-Id: Ib3f1e863100c1c421a6c0a4081b1d40696d67b23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 92b15beb9aa09467583230a018c23114bb666a8e)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/kernel/qnetworkinformation.cpp | 5 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinformation.h | 2 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinformation_p.h | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/network/kernel/qnetworkinformation.cpp b/src/network/kernel/qnetworkinformation.cpp index 2b0493ee26..9696a4fcc2 100644 --- a/src/network/kernel/qnetworkinformation.cpp +++ b/src/network/kernel/qnetworkinformation.cpp @@ -91,7 +91,6 @@ private: static bool initializeList(); std::unique_ptr<QNetworkInformationBackend> backend; - bool m_isOnline = true; // cached }; bool QNetworkInformationPrivate::initializeList() @@ -461,7 +460,7 @@ QNetworkInformation::QNetworkInformation(QNetworkInformationBackend *backend) : QObject(*(new QNetworkInformationPrivate(backend))) { connect(backend, &QNetworkInformationBackend::reachabilityChanged, this, - [this]() { emit reachabilityChanged(d_func()->backend->m_reachability); }); + [this]() { emit reachabilityChanged(d_func()->backend->reachability()); }); } /*! @@ -485,7 +484,7 @@ QNetworkInformation::~QNetworkInformation() = default; QNetworkInformation::Reachability QNetworkInformation::reachability() const { - return d_func()->backend->m_reachability; + return d_func()->backend->reachability(); } /*! diff --git a/src/network/kernel/qnetworkinformation.h b/src/network/kernel/qnetworkinformation.h index eddabc9707..a04e725300 100644 --- a/src/network/kernel/qnetworkinformation.h +++ b/src/network/kernel/qnetworkinformation.h @@ -70,7 +70,7 @@ public: Q_ENUM(Feature) Q_DECLARE_FLAGS(Features, Feature) - ~QNetworkInformation(); + ~QNetworkInformation() override; Reachability reachability() const; diff --git a/src/network/kernel/qnetworkinformation_p.h b/src/network/kernel/qnetworkinformation_p.h index 389310cc43..8cb31e6641 100644 --- a/src/network/kernel/qnetworkinformation_p.h +++ b/src/network/kernel/qnetworkinformation_p.h @@ -64,11 +64,13 @@ class Q_NETWORK_EXPORT QNetworkInformationBackend : public QObject Q_OBJECT public: QNetworkInformationBackend() = default; - virtual ~QNetworkInformationBackend(); + ~QNetworkInformationBackend() override; virtual QString name() const = 0; virtual QNetworkInformation::Features featuresSupported() const = 0; + QNetworkInformation::Reachability reachability() const { return m_reachability; } + Q_SIGNALS: void reachabilityChanged(); |