summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qnetworkinformation.h
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2021-06-03 13:27:56 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2021-06-08 14:54:16 +0200
commit14b74af0608dc833f836acac4ee93f905b449806 (patch)
tree84db5450f302d0de9ba140c8a9d223324e4fe988 /src/network/kernel/qnetworkinformation.h
parentc34b596119b1fd05082b69b77eb86a99f658a22b (diff)
QNetworkInformation: Adjustments to captive portal API
Make it return bool since the TriState was really only used signify that the property was unsupported but there is already a separate way to check if it's supported. More importantly there is no different set of actions available to a user if they're in the Unknown or False state. Because of the change to bool, we also rename the property to have an 'is'-prefix. Change-Id: Iaaaad5ac31e663c36e00223bf5b0e719f412fc69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/network/kernel/qnetworkinformation.h')
-rw-r--r--src/network/kernel/qnetworkinformation.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/network/kernel/qnetworkinformation.h b/src/network/kernel/qnetworkinformation.h
index 6e700747bb..7fa43a4187 100644
--- a/src/network/kernel/qnetworkinformation.h
+++ b/src/network/kernel/qnetworkinformation.h
@@ -55,7 +55,7 @@ class Q_NETWORK_EXPORT QNetworkInformation : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QNetworkInformation)
Q_PROPERTY(Reachability reachability READ reachability NOTIFY reachabilityChanged)
- Q_PROPERTY(TriState behindCaptivePortal READ behindCaptivePortal NOTIFY behindCaptivePortalChanged)
+ Q_PROPERTY(bool isBehindCaptivePortal READ isBehindCaptivePortal NOTIFY isBehindCaptivePortalChanged)
public:
enum class Reachability {
Unknown,
@@ -66,13 +66,6 @@ public:
};
Q_ENUM(Reachability)
- enum class TriState {
- False,
- True,
- Unknown,
- };
- Q_ENUM(TriState)
-
enum class Feature {
Reachability = 0x1,
CaptivePortal = 0x2,
@@ -82,7 +75,7 @@ public:
Reachability reachability() const;
- TriState behindCaptivePortal() const;
+ bool isBehindCaptivePortal() const;
QString backendName() const;
@@ -95,7 +88,7 @@ public:
Q_SIGNALS:
void reachabilityChanged(Reachability newReachability);
- void behindCaptivePortalChanged(TriState state);
+ void isBehindCaptivePortalChanged(bool state);
private:
friend struct QNetworkInformationDeleter;