lanlinkprovider: Load backend explicitly to avoid nullptr warning

This is needed to make it work properly with Qt6 at runtime
This commit is contained in:
Alexander Lohnau 2023-06-26 08:36:56 +02:00
parent f57d59e605
commit 1dadbd47b2

View file

@ -72,6 +72,7 @@ LanLinkProvider::LanLinkProvider(bool testMode, quint16 udpBroadcastPort, quint1
});
#else
// Detect when a network interface changes status, so we announce ourselves in the new network
QNetworkInformation::instance()->loadBackendByFeatures(QNetworkInformation::Feature::Reachability);
connect(QNetworkInformation::instance(), &QNetworkInformation::reachabilityChanged, this, [this]() {
if (QNetworkInformation::instance()->reachability() == QNetworkInformation::Reachability::Online) {
onNetworkChange();