Skip to content

Commit

Permalink
Merge pull request #76 from lpotter/master
Browse files Browse the repository at this point in the history
[connectionagent] fix disconnecting mobile data when connecting to wlan
  • Loading branch information
lpotter committed Jun 27, 2014
2 parents 5ba9ffb + d151ead commit 4fd8ed4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions connd/qconnectionagent.cpp
Expand Up @@ -234,6 +234,12 @@ void QConnectionAgent::serviceStateChanged(const QString &state)
qDebug() << state << service->name() << service->strength();
qDebug() << "currentNetworkState" << currentNetworkState;

if (state == "ready" && service->type() == "wifi"
&& !delayedTethering
&& netman->defaultRoute()->type() == "cellular") {
netman->defaultRoute()->requestDisconnect();
}

if (!service->favorite() || !netman->getTechnology(service->type())
|| !netman->getTechnology(service->type())->powered()) {
qDebug() << "not fav or not powered";
Expand All @@ -253,11 +259,7 @@ void QConnectionAgent::serviceStateChanged(const QString &state)
if (delayedTethering && service->type() == "wifi" && state == "association") {
service->requestDisconnect();
}
if (state == "ready" && service->type() == "wifi"
&& !delayedTethering
&& netman->defaultRoute()->type() == "cellular") {
netman->defaultRoute()->requestDisconnect();
}

if (state == "online") {
Q_EMIT connectionState(state, service->type());

Expand Down

0 comments on commit 4fd8ed4

Please sign in to comment.