Port away from Qt Network Bearer Management
Open, Needs TriagePublic

Description

Bearer Management is deprecated in 5.15 (https://doc-snapshots.qt.io/qt5-5.15/bearer-management.html), but I don't see any alternatives mentioned.

This includes QNetworkConfigurationManager, QNetworkConfiguration and QNetworkSession.

There's a significant amount of KDE code that uses QNetworkConfigurationManager et al.

https://lists.qt-project.org/pipermail/development/2019-November/037923.html says new API is supposed to cover the relevant use cases, so we need to check what we actually need and request it

nicolasfella updated the task description. (Show Details)May 9 2020, 4:24 PM
ahmadsamir added a subscriber: ahmadsamir.

The primary use of this seems to be checking for network availability, not anything more detailed.

A possible starting point for a replacement could be NetworkStatus in here: https://invent.kde.org/pim/itinerary/-/tree/master/src/solidextras - and as the folder name already tells you, I'd see that in Solid eventually. The API is minimal (connected: yes/no/unknown, metered: yes/no/unknown, QML compatible), backends exist for XDG Portal, NetworkManager and Android, so at least Windows is definitely missing, *BSD might or might not work via the XDG Portal API, no idea. Is that sufficient? Ok to add that to Solid?

This isn't something we have to wait with for a Qt6 port, we can already add the replacement now and move over to that. That might even bring immediate benefits for Flatpak users, as this would avoid the need of allowing access to the host NM and rather only go through the portal.

broulik added a subscriber: broulik.EditedFeb 8 2021, 12:52 PM

There's now a QNetworkInformation class [1]. Currently it only does "is online", no captive portal support and no metered detection. It's a start at least.

Maybe we could help upstream on that epic: https://bugreports.qt.io/browse/QTBUG-91021

I already moaned about lack of captive portal detection API in the "isHostReachable" task :)

[1] https://codereview.qt-project.org/c/qt/qtbase/+/327554 and https://codereview.qt-project.org/c/qt/qtbase/+/327993

ervin moved this task from Needs Input to Waiting on Qt Changes on the KF6 board.Mar 28 2021, 8:16 AM
alex added a subscriber: alex.

The relevant Qt bugs were fixed, once we branch KF6 we can port to this new API.

It looks like alot of the usage of QNetworkConfigurationManager is about the QNCM::onlineStateChanged signal, which can be ported to using QNetworkInformation::reachabilityChanged in Qt6. https://lxr.kde.org/search?%21v=kf5-qt5&_filestring=&_string=QNetworkConfigurationManager

The only other usage I know of is KIO's ProxyScout, which might be ported to QNetworkInforamtion too https://invent.kde.org/frameworks/kio/-/merge_requests/677 though I am not sure yet (and can't test, no access to a proxy setup).

vkrause moved this task from Waiting on KF6 Branching to Done on the KF6 board.Jan 29 2023, 2:49 PM