From fa7451043e3e41690c292905866e3ddfe029f705 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Wed, 20 Nov 2013 06:41:55 +1000 Subject: 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 Reviewed-by: Robin Burchell --- src/plugins/bearer/connman/qconnmanengine.cpp | 8 +++++++- src/plugins/bearer/connman/qconnmanengine.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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; }; -- cgit v1.2.3