winrt: no assert when device is in airplane mode/has no internet connection
Task-number: QTBUG-49478 Change-Id: I1b95ca736d454f82f84374554e6cdec2555d29de Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
This commit is contained in:
parent
2ab6963e95
commit
fecbe76d6e
@ -76,6 +76,9 @@ static QNetworkInterfacePrivate *interfaceFromProfile(IConnectionProfile *profil
|
||||
|
||||
ComPtr<INetworkAdapter> adapter;
|
||||
hr = profile->get_NetworkAdapter(&adapter);
|
||||
// Indicates that no internet connection is available/the device is in airplane mode
|
||||
if (hr == E_INVALIDARG)
|
||||
return 0;
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
UINT32 type;
|
||||
hr = adapter->get_IanaInterfaceType(&type);
|
||||
|
@ -201,6 +201,9 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
|
||||
|
||||
ComPtr<INetworkAdapter> adapter;
|
||||
hr = profile->get_NetworkAdapter(&adapter);
|
||||
// Indicates that no internet connection is available/the device is in airplane mode
|
||||
if (hr == E_INVALIDARG)
|
||||
return QNetworkConfiguration::BearerUnknown;
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
GUID id;
|
||||
hr = adapter->get_NetworkAdapterId(&id);
|
||||
|
Loading…
Reference in New Issue
Block a user