diff options
author | Matt Porter <mporter@konsulko.com> | 2018-07-27 11:54:56 -0400 |
---|---|---|
committer | Matt Porter <mporter@konsulko.com> | 2018-07-27 11:54:56 -0400 |
commit | 0c4d8bf4e0af08563c907148216ffdb485dd1922 (patch) | |
tree | b6934d4d2c483a017705ab23e46f866f6c39f826 /network/wifinetworkmodel.cpp | |
parent | cd445ba31ca2f4ca4cec0ce7d451f50fa6c5fa72 (diff) |
network: add wifiStrength property
Add a wifiStrength property which exposes the signal strength
of the currently connected network. This is intended to be
used by global status indicators, such as a status bar WiFi
strength indicator.
Bug-AGL: SPEC-1626
Change-Id: I7285b04095bc67278c862fc363a2dfbfff57d44d
Signed-off-by: Matt Porter <mporter@konsulko.com>
Diffstat (limited to 'network/wifinetworkmodel.cpp')
-rw-r--r-- | network/wifinetworkmodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/network/wifinetworkmodel.cpp b/network/wifinetworkmodel.cpp index 8a83919..3cfd7dd 100644 --- a/network/wifinetworkmodel.cpp +++ b/network/wifinetworkmodel.cpp @@ -163,6 +163,9 @@ void WifiNetworkModel::updateProperties(QString service, QJsonObject properties) if (properties.contains("strength")) { network->setStrength(properties.value("strength").toInt()); emit dataChanged(indexOf(network), indexOf(network)); + if ((network->state() == "ready") || + (network->state() == "online")) + emit strengthChanged(network->strength()); } } } |