Comment 88 for bug 1585863

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

I missed this commit. It should work now.

From 6eaded9071fbf868476255adb8ee5f416e7ad134 Mon Sep 17 00:00:00 2001
From: Thomas Haller <email address hidden>
Date: Tue, 14 Feb 2017 12:45:38 +0100
Subject: [PATCH] device: add get_autoconnect_allowed() virtual function

It allows derived classes to override the autoconnect-allowed
state.

We already have

- NM_DEVICE_AUTOCONNECT property, which is two parts:
  - NMDevicePrivate::autoconnect_user, which is settable via
    D-Bus by the use, to allow the device to autoconnect.
  - NMDevicePrivate::autoconnect_intern, which is set by
    internal decision.
- NM_DEVICE_AUTOCONNECT_ALLOWED signal, where other devices can
  subscribe to block autoconnect. Currently that is only used
  by NMDeviceOlpcMesh.

These two make up for nm_device_autoconnect_allowed().

Add another way to allow derived classes to disable autoconnect
temporarily. This could also be achieved by having the device
subscribe to NM_DEVICE_AUTOCONNECT_ALLOWED of self, or by adding
a signal slot. But a plain function pointer seems easier.