fix connman QNetworkConfiguration Discovered

Make Discovered depend on autoconnectable service

This stops seemingly automatic use of a non autconnectable service,
and allows the connection dialog to popup.

Change-Id: Idea9a22eb4bbfb4fefeca7867526a2ddc3954376
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
Lorn Potter 2013-10-18 05:29:25 +10:00 committed by The Qt Project
parent c28763d83c
commit 1db89eb5a4

View File

@ -417,14 +417,16 @@ QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QStri
QConnmanServiceInterface serv(service);
QNetworkConfiguration::StateFlags flag = QNetworkConfiguration::Defined;
if (serv.getType() == "cellular") {
if(serv.isSetupRequired()) {
if (serv.isSetupRequired() || !serv.isAutoConnect()) {
flag = ( flag | QNetworkConfiguration::Defined);
} else {
flag = ( flag | QNetworkConfiguration::Discovered);
}
} else {
if (serv.isFavorite()) {
if (serv.isAutoConnect()) {
flag = ( flag | QNetworkConfiguration::Discovered);
}
} else {
flag = QNetworkConfiguration::Undefined;
}