From 0c4d8bf4e0af08563c907148216ffdb485dd1922 Mon Sep 17 00:00:00 2001 From: Matt Porter Date: Fri, 27 Jul 2018 11:54:56 -0400 Subject: 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 --- network/wifinetworkmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'network/wifinetworkmodel.cpp') 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()); } } } -- cgit 1.2.3-korg