always use connman to connect to cellular services

connman provides better error messages.

Change-Id: Ifcfd4a4ff8d632273ab9ff7478a6c43cbf2cde98
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
bb10
Lorn Potter 2013-10-09 17:20:24 +10:00 committed by The Qt Project
parent 9764f86027
commit b12bec0fcf
1 changed files with 2 additions and 27 deletions

View File

@ -150,20 +150,7 @@ void QConnmanEngine::connectToId(const QString &id)
if(!serv.isValid()) {
emit connectionError(id, QBearerEngineImpl::InterfaceLookupError);
} else {
if(serv.getType() != "cellular") {
serv.connect();
} else {
QOfonoManagerInterface ofonoManager(0);
QString modemPath = ofonoManager.currentModem().path();
QOfonoDataConnectionManagerInterface dc(modemPath,0);
foreach (const QDBusObjectPath &dcPath,dc.getPrimaryContexts()) {
if(dcPath.path().contains(servicePath.section("_",-1))) {
QOfonoConnectionContextInterface primaryContext(dcPath.path(),0);
primaryContext.setActive(true);
}
}
}
serv.connect();
}
}
@ -175,19 +162,7 @@ void QConnmanEngine::disconnectFromId(const QString &id)
if(!serv.isValid()) {
emit connectionError(id, DisconnectionError);
} else {
if(serv.getType() != "cellular") {
serv.disconnect();
} else {
QOfonoManagerInterface ofonoManager(0);
QString modemPath = ofonoManager.currentModem().path();
QOfonoDataConnectionManagerInterface dc(modemPath,0);
foreach (const QDBusObjectPath &dcPath,dc.getPrimaryContexts()) {
if(dcPath.path().contains(servicePath.section("_",-1))) {
QOfonoConnectionContextInterface primaryContext(dcPath.path(),0);
primaryContext.setActive(false);
}
}
}
serv.disconnect();
}
}