Disable automatic connection switch

Federico Buti bacarozzo at gmail.com
Wed Jul 19 08:03:55 UTC 2017


Hi list.

I've been tasked from my boss to write a little wrapper for
NetworkManagerQt to provide specific operations suited from the devices of
my company.

Currently the devices have wifi, umts modem and ethernet interfaces. The
latter should not be used to communicate with our server thus I've added
"never-default = true" to the eth. configuration we create. In most of
other connections we heavily rely on "autoConnect" set to true so that once
a connection with higher priority is available the NM just switches to that
(e.g. umts modem to wifi).

So far, so good. Among the requirements of the API I should provide there
must be a function do disable the automatic switch of connections. In
certain cases we want that the current primary connection remains the
primary one even if a connection with higher priority is available.

I thought about using again "never-default". Once my API to disable
connections switch is called I simply set "never-default" to true on all
the available connections expect the primary one. That is the most obvious
approach I could come up with by reading NM API documentation.

Now, questions time:

   - Is my interpretation of the NM API correct?
   - Is it the "right" approach?
   - Is there a more smart/easy approach?


Thanks in advance,
F.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170719/3798b86c/attachment.html>


More information about the Kde-frameworks-devel mailing list