Skip to content

networking: KnownNetwork - #1238

Open
cpwrs wants to merge 2 commits into
quickshell-mirror:masterfrom
cpwrs:knownnetwork
Open

cpwrs wants to merge 2 commits into
quickshell-mirror:masterfrom
cpwrs:knownnetwork

Conversation

@cpwrs

@cpwrs cpwrs commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

This PR transitions NMSettings to a backend-agnostic KnownNetwork object and adds a toplevel Networking.knownNetworks list. Also adds a slew of related NM backend changes.

API Changes

  • NMSettings -> KnownNetwork
    • NMSettings.id -> KnownNetwork.name
    • Removes NMSettings.uuid
  • Adds Networking.knownNetworks
  • NetworkDevice.nmSettings -> NetworkDevice.knownNetworks
  • NetworkDevice.connectWithSettings -> NetworkDevice.connectToKnownNetwork

Backend Changes

  • Renames that keep the naming consistent between files and with the NM DBus API (namely NMSettings -> NMConnection)
  • Adds the NMConnectionManager which handles registration of the NMConnections
  • NMDevices use NMConnectionManager for references to their available conns instead of registering conns themselves
  • Update the settingsTypeTo/FromQml utils to cover an exhaustive list of settings whose conversion isn't automatically supported

Why?

These API changes were mostly to address having backend-specific objects littering the frontend. This change allows us to support settings schemas for different backends without having to expose properties for each of the hundreds of settings. The class is also a good place to add some common settings as Q_PROPERTYs if we want in the future.

The toplevel list is an easy way to edit any settings, even those of unavailable networks.
This is a prerequisite for #922 which could now look like Networking.addNetwork(settings).

@cpwrs
cpwrs marked this pull request as ready for review October 2, 2026 13:35
@cpwrs
cpwrs marked this pull request as draft October 2, 2026 14:15
Comment on lines -240 to +248
if (this->mAccessPoints.contains(ap->path())) return;
this->mAccessPoints.insert(ap->path(), ap);
auto onDestroyed = [this, ap]() {
if (this->mAccessPoints.take(ap->path())) {
const QString path = ap->path();
if (this->mAccessPoints.contains(path)) return;
this->mAccessPoints.insert(path, ap);
auto onDestroyed = [this, ap, path]() {
if (this->mAccessPoints.take(path)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is unrelated to the PR

Captures path instead of assuming ap->path() can be accessed after its QObject destroyed signal


namespace {
QS_LOGGING_CATEGORY(logNetworkManager, "quickshell.network.networkmanager", QtWarningMsg);
const QStringList SUPPORTED_CONNECTION_TYPES {"802-11-wireless", "802-3-ethernet"};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I restricted connection types to be the same as supported device types. But we can include all connections here as long as I update settingTypeTo/FromQml.

@cpwrs
cpwrs marked this pull request as ready for review October 2, 2026 18:24
@outfoxxed
outfoxxed force-pushed the master branch 2 times, most recently from 72a1ce2 to 11ca60b Compare October 6, 2026 04:21
@cpwrs

cpwrs commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

I can easily keep support for the old API and mark it deprecated.

Also I think every backend change is justified even without the API change. I'll open a PR with those if I can't get this approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant