Skip to content

Commit

Permalink
[connectionagent] Do not signal dbus Method errors
Browse files Browse the repository at this point in the history
and discard connect-failed errors from mobiledata
when flightmode is enabled.
  • Loading branch information
Lorn Potter committed Apr 19, 2014
1 parent 9673507 commit f1d6a21
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions connd/qconnectionagent.cpp
Expand Up @@ -152,6 +152,10 @@ void QConnectionAgent::onUserInputCanceled()
// from useragent
void QConnectionAgent::onErrorReported(const QString &servicePath, const QString &error)
{
if (error == "connect-failed"
&& (servicePath.contains("cellular") && netman->offlineMode())) {
return;
}
qDebug() << "<<<<<<<<<<<<<<<<<<<<" << servicePath << error;
Q_EMIT errorReported(servicePath, error);
}
Expand Down Expand Up @@ -206,9 +210,14 @@ void QConnectionAgent::serviceErrorChanged(const QString &error)
if (error == "Operation aborted")
return;
NetworkService *service = static_cast<NetworkService *>(sender());
if (error == "connect-failed")
service->requestDisconnect();
if (error != "In progress")

if (error == "connect-failed"
&& (service->type() == "cellular") && netman->offlineMode()) {
return;
}
if (error == "In progress" || error.contains("Method")) // catch dbus errors and discard
return;

Q_EMIT errorReported(service->path(),error);
}

Expand Down

0 comments on commit f1d6a21

Please sign in to comment.