diff options
author | Lorn Potter <lorn.potter@jollamobile.com> | 2013-11-20 06:41:55 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-11 03:30:57 +0100 |
commit | fa7451043e3e41690c292905866e3ddfe029f705 (patch) | |
tree | 16fa420172b878f5fd725e1e6fc69783e0bfd2f5 | |
parent | 1db89eb5a4cbe98d8380410de3acc527fc53f911 (diff) | |
download | qtbase-fa7451043e3e41690c292905866e3ddfe029f705.tar.gz qtbase-fa7451043e3e41690c292905866e3ddfe029f705.tar.bz2 qtbase-fa7451043e3e41690c292905866e3ddfe029f705.zip |
make 'AlwaysAsk' if found help determine whether the configuration is Discovered or not.
Since bearer has no idea about user interaction, we just do this,
and make the roaming/always ask scenario unavailable.
Change-Id: Id509a4d3346cdbb9367ddb465364c3500fc62fdf
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
-rw-r--r-- | src/plugins/bearer/connman/qconnmanengine.cpp | 8 | ||||
-rw-r--r-- | src/plugins/bearer/connman/qconnmanengine.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp index 7633b4f2b8..eac0d2b813 100644 --- a/src/plugins/bearer/connman/qconnmanengine.cpp +++ b/src/plugins/bearer/connman/qconnmanengine.cpp @@ -417,7 +417,7 @@ QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QStri QConnmanServiceInterface serv(service); QNetworkConfiguration::StateFlags flag = QNetworkConfiguration::Defined; if (serv.getType() == "cellular") { - if (serv.isSetupRequired() || !serv.isAutoConnect()) { + if (serv.isSetupRequired() || !serv.isAutoConnect() || (serv.isRoaming() && isAlwaysAskRoaming())) { flag = ( flag | QNetworkConfiguration::Defined); } else { flag = ( flag | QNetworkConfiguration::Discovered); @@ -593,6 +593,12 @@ bool QConnmanEngine::requiresPolling() const return false; } +bool QConnmanEngine::isAlwaysAskRoaming() +{ + QSettings confFile(QStringLiteral("nemomobile"), QStringLiteral("connectionagent")); + confFile.beginGroup(QStringLiteral("Connectionagent")); + return confFile.value(QStringLiteral("askForRoaming")).toBool(); +} QT_END_NAMESPACE #endif // QT_NO_DBUS diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h index c2a820997e..49a1a91d29 100644 --- a/src/plugins/bearer/connman/qconnmanengine.h +++ b/src/plugins/bearer/connman/qconnmanengine.h @@ -129,6 +129,7 @@ private: QNetworkConfiguration::BearerType ofonoTechToBearerType(const QString &type); bool isRoamingAllowed(const QString &context); + bool isAlwaysAskRoaming(); protected: bool requiresPolling() const; }; |