Use allConfigurations instead of onlineConfigurations in isOnline()
We need it because otherwise code like QNetworkConfigurationManager ncm; qDebug() << "ONLINE" << ncm->isOnline(); may give the wrong value because the queued signals that have been just connected a few lines above may not have been processed yet Change-Id: I959db75ed17497ab91eeba2669ee2c8947244f00 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This commit is contained in:
parent
633b950bd4
commit
1458d1b31d
@ -276,7 +276,9 @@ bool QNetworkConfigurationManagerPrivate::isOnline() const
|
|||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
return !onlineConfigurations.isEmpty();
|
// We need allConfigurations since onlineConfigurations is filled with queued connections
|
||||||
|
// and thus is not always (more importantly just after creation) up to date
|
||||||
|
return !allConfigurations(QNetworkConfiguration::Active).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkConfigurationManager::Capabilities QNetworkConfigurationManagerPrivate::capabilities() const
|
QNetworkConfigurationManager::Capabilities QNetworkConfigurationManagerPrivate::capabilities() const
|
||||||
|
Loading…
Reference in New Issue
Block a user