make qtbearer networkmanager defaultConfiguration more reliable
The defaultConfiguration could switch and be either active connection, so we determine the default should be what has the default route. Change-Id: I194f27b60e7a3598eca2ff09c2225ba1a46564d9 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This commit is contained in:
parent
a61247723a
commit
7a593e0d00
@ -953,6 +953,15 @@ QNetworkSessionPrivate *QNetworkManagerEngine::createSessionBackend()
|
||||
|
||||
QNetworkConfigurationPrivatePointer QNetworkManagerEngine::defaultConfiguration()
|
||||
{
|
||||
QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
QNetworkManagerConnectionActive *activeConnection = i.value();
|
||||
if ((activeConnection->defaultRoute() || activeConnection->default6Route())) {
|
||||
return accessPointConfigurations.value(activeConnection->connection().path());
|
||||
}
|
||||
}
|
||||
|
||||
return QNetworkConfigurationPrivatePointer();
|
||||
}
|
||||
|
||||
|
@ -1282,6 +1282,13 @@ bool QNetworkManagerConnectionActive::defaultRoute() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QNetworkManagerConnectionActive::default6Route() const
|
||||
{
|
||||
if (propertyMap.contains("Default6"))
|
||||
return propertyMap.value("Default6").toBool();
|
||||
return false;
|
||||
}
|
||||
|
||||
void QNetworkManagerConnectionActive::propertiesSwap(QMap<QString,QVariant> map)
|
||||
{
|
||||
QMapIterator<QString, QVariant> i(map);
|
||||
|
@ -499,6 +499,7 @@ public:
|
||||
QStringList devices() const;
|
||||
quint32 state() const;
|
||||
bool defaultRoute() const;
|
||||
bool default6Route() const;
|
||||
bool setConnections();
|
||||
bool isValid();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user