libnm: revert coercing NMVpnConnectionStateReason to NMActiveConnectionStateReason

System Internals / NetworkManager - Thomas Haller [redhat.com] - 17 March 2017 08:00 EDT

NMVpnConnectionStateReason is no longer used and replaced by NMActiveConnectionStateReason. However, the old enums should stay in place as they were:

Otherwise: #define NMVpnConnectionStateReason NMActiveConnectionStateReason causes compiler warnings: NMVpnConnectionStateReason x; x = NM_VPN_CONNECTION_STATE_REASON_UNKNOWN; // -Wenum-conversion if (x == NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS) { } // -Wenum-compare

Similarly, a user who didn't upgrade shall continue to get the old GType for NM_TYPE_VPN_CONNECTION_STATE_REASON.

In practice, old users will have no issues using the old enum the places where it worked before. The only use of the deprecated enum is in vpn_state_changed() signal slot of NMVpnConnection. This makes the signal slot itself deprecated. However, NMVpnConnection is an NMObject and commonly created within libnm itself, not by the user. It is very unlikely that a user of libnm subclassed NMVpnConnection and makes use of the
vpn_state_changed() signal slot. So, deprecate it without replacement.

Fixes: a91369f80d44d1fc748fc3a9f5d9ef0fb566c77c

5022e3b libnm: revert coercing NMVpnConnectionStateReason to NMActiveConnectionStateReason
libnm-core/nm-vpn-dbus-interface.h | 3 +--
libnm/nm-vpn-connection.c | 10 ++++------
libnm/nm-vpn-connection.h | 13 +++++++++----
3 files changed, 14 insertions(+), 12 deletions(-)

Upstream: cgit.freedesktop.org


  • Share