From 21182e3decee4f66991127662235192711a9291e Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 17 Jun 2014 05:55:29 +1000 Subject: [PATCH] [connectionagent] disconnect mobile data if wifi becomes ready --- connd/qconnectionagent.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connd/qconnectionagent.cpp b/connd/qconnectionagent.cpp index 520a3ff..54585ab 100644 --- a/connd/qconnectionagent.cpp +++ b/connd/qconnectionagent.cpp @@ -249,6 +249,11 @@ 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());