diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-05-19 14:27:53 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-05-19 15:47:15 +0300 |
commit | 26c94a0c7fb55d9b52b33d29477763df425fed35 (patch) | |
tree | a7f6780c23780abc8035958f685462e0b3907621 | |
parent | a23036aec3188197c3c8d469cd785c9a812f6616 (diff) |
Don't show Wi-Fi group box on iMX6-eAndroid
This device currently does not support wifi.
Change-Id: I8048d7109908c4c2de553dda119cb14be73ef6a7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r-- | src/imports/wifi/pluginmain.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/imports/wifi/pluginmain.cpp b/src/imports/wifi/pluginmain.cpp index 6dc6cc9..51a2e7c 100644 --- a/src/imports/wifi/pluginmain.cpp +++ b/src/imports/wifi/pluginmain.cpp @@ -66,18 +66,19 @@ public: Q_INVOKABLE bool wifiSupported() const { - bool supported = false; + bool hasInterface = QDir().exists(QStringLiteral("/sys/class/net/wlan0")); + if (!hasInterface) + qWarning() << "QWifiGlobal: could not find wifi interface in /sys/class/net/"; #ifdef Q_OS_ANDROID - if (wifi_load_driver() == 0 && wifi_start_supplicant(0) == 0) - supported = true; - else + if (hasInterface && wifi_load_driver() == 0 && wifi_start_supplicant(0) == 0) { + return true; + } else { qWarning() << "QWifiGlobal: wifi driver is not available"; + return false; + } #else - supported = QDir().exists(QStringLiteral("/sys/class/net/wlan0")); - if (!supported) - qWarning() << "QWifiGlobal: could not find wifi interface in /sys/class/net/"; + return hasInterface; #endif - return supported; } }; |