Commit 3dee8034 authored by Slava Monich's avatar Slava Monich

[connectionagent] Tweak connection dialog behavior

Silently fail the request if no services of the requested type is found.
parent fd5262e7
......@@ -308,6 +308,7 @@ void QConnectionAgent::connectToType(const QString &type)
return;
}
// Connman is using "cellular" and "wifi" as part of the service path
QString convType;
if (type.contains("mobile")) {
convType="cellular";
......@@ -317,16 +318,17 @@ void QConnectionAgent::connectToType(const QString &type)
convType=type;
}
bool found = false;
Q_FOREACH (Service elem, orderedServicesList) {
if (elem.path.contains(type)) {
if (elem.path.contains(convType)) {
if (!isStateOnline(elem.service->state())) {
if (elem.service->autoConnect()) {
qDebug() << "<<<<<<<<<<< requestConnect() >>>>>>>>>>>>";
elem.service->requestConnect();
return;
} else if (elem.path.contains("cellular")) {
// do not continue if cellular is not autoconnect
return;
} else if (!elem.path.contains("cellular")) {
// ignore cellular that are not on autoconnect
found = true;
}
} else {
return;
......@@ -334,11 +336,13 @@ void QConnectionAgent::connectToType(const QString &type)
}
}
if (type.contains("cellular")) {
convType="mobile";
} else if (type.contains("wifi")) {
// Can't connect to the service of a type that doesn't exist
if (!found)
return;
// Substitute "wifi" with "wlan" for lipstick
if (type.contains("wifi"))
convType="wlan";
}
Q_EMIT configurationNeeded(convType);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment