Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[connectionagent] do not try to connect if already connected when
autoconnect property changes
  • Loading branch information
Lorn Potter committed Jun 6, 2014
1 parent 9e69c51 commit 7944074
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions connd/qconnectionagent.cpp
Expand Up @@ -628,19 +628,21 @@ void QConnectionAgent::serviceAutoconnectChanged(bool on)
servicesMap.value(selectedServicePath)->requestConnect();
}
} else {
if (service->type() == "cellular") {
QVector<NetworkService*> cellServices = netman->getServices("cellular");
Q_FOREACH (NetworkService *cService, cellServices) {
if (isStateOnline(cService->state())) {
mobileConnected = true;
if (!isStateOnline(service->state())) {
if (service->type() == "cellular") {
QVector<NetworkService*> cellServices = netman->getServices("cellular");
Q_FOREACH (NetworkService *cService, cellServices) {
if (isStateOnline(cService->state())) {
mobileConnected = true;
}
}
}
}

if ((service->type() == "wifi" && mobileConnected)
|| isBestService(service)) {
qDebug() << "<<<<<<<<<<< requestConnect() >>>>>>>>>>>>";
service->requestConnect();
if ((service->type() == "wifi" && mobileConnected)
|| isBestService(service)) {
qDebug() << "<<<<<<<<<<< requestConnect() >>>>>>>>>>>>";
service->requestConnect();
}
}
}
}
Expand Down

0 comments on commit 7944074

Please sign in to comment.