mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 06:30:33 +01:00
vpn: restore VpnStateChanged D-Bus signal API
The DNS change frequency reduction patches mistakenly changed the signature of the VpnStateChanged signal. Fix that, since we try really really hard not to break the D-Bus API in stable branches. My bad...
This commit is contained in:
parent
0b33b42771
commit
815a0b18e1
4 changed files with 22 additions and 6 deletions
|
|
@ -104,6 +104,7 @@ typedef struct {
|
|||
enum {
|
||||
PROPERTIES_CHANGED,
|
||||
VPN_STATE_CHANGED,
|
||||
INTERNAL_STATE_CHANGED,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
|
@ -223,7 +224,8 @@ nm_vpn_connection_set_vpn_state (NMVPNConnection *connection,
|
|||
*/
|
||||
g_object_ref (connection);
|
||||
|
||||
g_signal_emit (connection, signals[VPN_STATE_CHANGED], 0, vpn_state, old_vpn_state, reason);
|
||||
g_signal_emit (connection, signals[VPN_STATE_CHANGED], 0, vpn_state, reason);
|
||||
g_signal_emit (connection, signals[INTERNAL_STATE_CHANGED], 0, vpn_state, old_vpn_state, reason);
|
||||
g_object_notify (G_OBJECT (connection), NM_VPN_CONNECTION_VPN_STATE);
|
||||
|
||||
switch (vpn_state) {
|
||||
|
|
@ -1600,7 +1602,15 @@ nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class)
|
|||
|
||||
/* signals */
|
||||
signals[VPN_STATE_CHANGED] =
|
||||
g_signal_new (NM_VPN_CONNECTION_VPN_STATE_CHANGED,
|
||||
g_signal_new ("vpn-state-changed",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
_nm_marshal_VOID__UINT_UINT,
|
||||
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
|
||||
|
||||
signals[INTERNAL_STATE_CHANGED] =
|
||||
g_signal_new (NM_VPN_CONNECTION_INTERNAL_STATE_CHANGED,
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@
|
|||
#define NM_VPN_CONNECTION_BANNER "banner"
|
||||
|
||||
/* Signals */
|
||||
#define NM_VPN_CONNECTION_VPN_STATE_CHANGED "vpn-state-changed"
|
||||
/* not exported: includes old reason code */
|
||||
#define NM_VPN_CONNECTION_INTERNAL_STATE_CHANGED "internal-state-changed"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -52,8 +53,13 @@ typedef struct {
|
|||
/* Signals */
|
||||
void (*vpn_state_changed) (NMVPNConnection *connection,
|
||||
NMVPNConnectionState new_state,
|
||||
NMVPNConnectionState old_state,
|
||||
NMVPNConnectionStateReason reason);
|
||||
|
||||
/* not exported over D-Bus */
|
||||
void (*internal_state_changed) (NMVPNConnection *connection,
|
||||
NMVPNConnectionState new_state,
|
||||
NMVPNConnectionState old_state,
|
||||
NMVPNConnectionStateReason reason);
|
||||
} NMVPNConnectionClass;
|
||||
|
||||
GType nm_vpn_connection_get_type (void);
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ nm_vpn_manager_activate_connection (NMVPNManager *manager,
|
|||
|
||||
vpn = nm_vpn_service_activate (service, connection, device, specific_object, user_requested, user_uid, error);
|
||||
if (vpn) {
|
||||
g_signal_connect (vpn, NM_VPN_CONNECTION_VPN_STATE_CHANGED,
|
||||
g_signal_connect (vpn, NM_VPN_CONNECTION_INTERNAL_STATE_CHANGED,
|
||||
G_CALLBACK (connection_vpn_state_changed),
|
||||
manager);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ nm_vpn_service_activate (NMVPNService *service,
|
|||
clear_quit_timeout (service);
|
||||
|
||||
vpn = nm_vpn_connection_new (connection, device, specific_object, user_requested, user_uid);
|
||||
g_signal_connect (vpn, NM_VPN_CONNECTION_VPN_STATE_CHANGED,
|
||||
g_signal_connect (vpn, NM_VPN_CONNECTION_INTERNAL_STATE_CHANGED,
|
||||
G_CALLBACK (connection_vpn_state_changed),
|
||||
service);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue