summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@blackberry.com>2013-06-26 17:37:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-28 23:05:57 +0200
commitc1ddaf4d21429b3dc5b18467a3e4f13904e363ba (patch)
tree01f4369376de27ea24403e2e1ab2a209aae0cef7 /tests
parentbe35b70ca1bf61d022f7dee9df4aaccbf715b25e (diff)
QNetworkConfiguration: add public member bearerTypeFamily()
... to let the user know whether he is on e.g. Wifi, 2G, 3G or 4G. In most cases, this is what the user wants to know anyhow, while e.g. BearerEVDO or BearerCDMA2000 go into too much detail. Task-number: QTBUG-31828 Change-Id: I244a4473feb40e106cbc08e09afdee07d4ecc8d7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/qnetworkconfiguration/main.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/manual/qnetworkconfiguration/main.cpp b/tests/manual/qnetworkconfiguration/main.cpp
index 8bf5983796..c611cfc9e2 100644
--- a/tests/manual/qnetworkconfiguration/main.cpp
+++ b/tests/manual/qnetworkconfiguration/main.cpp
@@ -51,6 +51,7 @@ class tst_qnetworkconfiguration : public QObject
private slots:
void bearerType();
+ void bearerTypeFamily();
};
void tst_qnetworkconfiguration::bearerType()
@@ -111,6 +112,28 @@ void tst_qnetworkconfiguration::bearerType()
}
}
+void tst_qnetworkconfiguration::bearerTypeFamily()
+{
+ QNetworkConfigurationManager m;
+ foreach (const QNetworkConfiguration &config,
+ m.allConfigurations(QNetworkConfiguration::Active)) {
+ QString family;
+ switch (config.bearerTypeFamily()) {
+ case QNetworkConfiguration::Bearer3G:
+ family = QLatin1String("Bearer3G");
+ break;
+ case QNetworkConfiguration::Bearer4G:
+ family = QLatin1String("Bearer4G");
+ break;
+ default:
+ family = config.bearerTypeName();
+ }
+ qDebug() << config.name() << "has bearer type"
+ << config.bearerTypeName() << "of bearer type family"
+ << family;
+ }
+}
+
QTEST_MAIN(tst_qnetworkconfiguration)
#include "main.moc"