libnm: merge device-type-specific errors into NMDeviceError

System Internals / NetworkManager - Dan Winship [gnome.org] - 22 October 2014 07:29 UTC

As with the settings, each device type was defining its own error type, containing either redundant or non-useful error codes. Drop all of the subtype-specific errors, and reduce things to just NM_DEVICE_ERROR_FAILED, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, and NM_DEVICE_ERROR_INVALID_CONNECTION.

The device-type-specific errors were only returned from their nm_device_connection_compatible() implementations, so this is also a good opportunity to simplify those, by moving duplicated functionality into the base NMDevice implementation, and then allowing the subclasses to assume that the connection has already been validated in their own code. Most of the implementations now just check that the connection has the correct type for the device (which can't be done at the NMDevice level since some device types (eg, Ethernet) support multiple connection types.)

Also, make sure that all of the error messages are localized.

69099f3 libnm: merge device-type-specific errors into NMDeviceError
libnm/libnm.ver | 26 -------------------
libnm/nm-device-adsl.c | 40 +++++------------------------
libnm/nm-device-adsl.h | 15 -----------
libnm/nm-device-bond.c | 48 +++++-----------------------------
libnm/nm-device-bond.h | 17 -------------
libnm/nm-device-bridge.c | 48 +++++-----------------------------
libnm/nm-device-bridge.h | 17 -------------
libnm/nm-device-bt.c | 51 ++++++++++---------------------------
libnm/nm-device-bt.h | 21 ---------------
libnm/nm-device-ethernet.c | 49 +++++++++--------------------------
libnm/nm-device-ethernet.h | 19 --------------
libnm/nm-device-generic.c | 40 ++++++++---------------------
libnm/nm-device-generic.h | 15 -----------
libnm/nm-device-infiniband.c | 48 +++++++++-------------------------
libnm/nm-device-infiniband.h | 19 --------------
libnm/nm-device-modem.c | 43 +++++++++----------------------
libnm/nm-device-modem.h | 17 -------------
libnm/nm-device-olpc-mesh.c | 40 +++++------------------------
libnm/nm-device-olpc-mesh.h | 15 -----------
libnm/nm-device-team.c | 48 +++++-----------------------------
libnm/nm-device-team.h | 17 -------------
libnm/nm-device-vlan.c | 57 +++++++++--------------------------------
libnm/nm-device-vlan.h | 21 ---------------
libnm/nm-device-wifi.c | 58 +++++++++++++-----------------------------
libnm/nm-device-wifi.h | 25 ------------------
libnm/nm-device-wimax.c | 47 ++++++++--------------------------
libnm/nm-device-wimax.h | 19 --------------
libnm/nm-device.c | 16 +++++++-----
libnm/nm-device.h | 14 ++++++----
po/POTFILES.in | 14 ++++++++++
30 files changed, 163 insertions(+), 761 deletions(-)

Upstream: cgit.freedesktop.org


  • Share