From e368866d68666eb32754aeeffda78bc338f7e2e1 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Fri, 21 Mar 2014 05:04:08 +1000 Subject: make sure connman bearer service is autconnect before connecting Change-Id: I4c9a93d69f7fe990bf9d7f2e939abbe2c82ba449 Reviewed-by: Robin Burchell --- src/plugins/bearer/connman/qconnmanengine.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/plugins/bearer') diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp index 797c30c7c6..0903496472 100644 --- a/src/plugins/bearer/connman/qconnmanengine.cpp +++ b/src/plugins/bearer/connman/qconnmanengine.cpp @@ -189,7 +189,20 @@ void QConnmanEngine::connectToId(const QString &id) if (!serv->isValid()) { emit connectionError(id, QBearerEngineImpl::InterfaceLookupError); } else { - serv->connect(); + if (serv->type() == QLatin1String("cellular")) { + if (serv->roaming()) { + if (!isRoamingAllowed(serv->path())) { + emit connectionError(id, QBearerEngineImpl::OperationNotSupported); + return; + } + if (isAlwaysAskRoaming()) { + emit connectionError(id, QBearerEngineImpl::OperationNotSupported); + return; + } + } + } + if (serv->autoConnect()) + serv->connect(); } } -- cgit v1.2.3