Can be simplified by removing "activeConfig.state() & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered"

It is not needed and guaranteed to be true, otherwise the error path above would have been taken.