summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2021-02-08 17:13:54 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2021-02-11 18:13:01 +0100
commit92b15beb9aa09467583230a018c23114bb666a8e (patch)
tree2428194cf3a57a487facc7572e1d5444e1ff7ec8 /src/network
parent153ffff7d53933784a19acbb14b3d8cacdea2ece (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>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/kernel/qnetworkinformation.cpp5
-rw-r--r--src/network/kernel/qnetworkinformation.h2
-rw-r--r--src/network/kernel/qnetworkinformation_p.h4
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();