mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 05:50:21 +01:00
vpn: remove unused connection activated/deactivated signals
Replaced by watching the connections' states directly.
This commit is contained in:
parent
f8f1a131f5
commit
43813cc563
2 changed files with 7 additions and 66 deletions
|
|
@ -44,15 +44,6 @@ typedef struct {
|
|||
guint monitor_id;
|
||||
} NMVPNManagerPrivate;
|
||||
|
||||
enum {
|
||||
CONNECTION_ACTIVATED,
|
||||
CONNECTION_DEACTIVATED,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
GQuark
|
||||
nm_vpn_manager_error_quark (void)
|
||||
{
|
||||
|
|
@ -113,28 +104,6 @@ find_active_vpn_connection_by_connection (NMVPNManager *self, NMConnection *conn
|
|||
return found;
|
||||
}
|
||||
|
||||
static void
|
||||
connection_vpn_state_changed (NMVPNConnection *connection,
|
||||
NMVPNConnectionState new_state,
|
||||
NMVPNConnectionState old_state,
|
||||
NMVPNConnectionStateReason reason,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMVPNManager *manager = NM_VPN_MANAGER (user_data);
|
||||
|
||||
switch (new_state) {
|
||||
case NM_VPN_CONNECTION_STATE_ACTIVATED:
|
||||
g_signal_emit (manager, signals[CONNECTION_ACTIVATED], 0, connection);
|
||||
break;
|
||||
case NM_VPN_CONNECTION_STATE_FAILED:
|
||||
case NM_VPN_CONNECTION_STATE_DISCONNECTED:
|
||||
g_signal_emit (manager, signals[CONNECTION_DEACTIVATED], 0, connection, new_state, old_state, reason);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
NMActiveConnection *
|
||||
nm_vpn_manager_activate_connection (NMVPNManager *manager,
|
||||
NMConnection *connection,
|
||||
|
|
@ -188,14 +157,13 @@ nm_vpn_manager_activate_connection (NMVPNManager *manager,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
vpn = nm_vpn_service_activate (service, connection, device, specific_object, user_requested, user_uid, error);
|
||||
if (vpn) {
|
||||
g_signal_connect (vpn, NM_VPN_CONNECTION_INTERNAL_STATE_CHANGED,
|
||||
G_CALLBACK (connection_vpn_state_changed),
|
||||
manager);
|
||||
}
|
||||
|
||||
return (NMActiveConnection *) vpn;
|
||||
return (NMActiveConnection *) nm_vpn_service_activate (service,
|
||||
connection,
|
||||
device,
|
||||
specific_object,
|
||||
user_requested,
|
||||
user_uid,
|
||||
error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
@ -417,23 +385,6 @@ nm_vpn_manager_class_init (NMVPNManagerClass *manager_class)
|
|||
/* virtual methods */
|
||||
object_class->dispose = dispose;
|
||||
|
||||
/* signals */
|
||||
signals[CONNECTION_ACTIVATED] =
|
||||
g_signal_new ("connection-activated",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, G_TYPE_OBJECT);
|
||||
|
||||
signals[CONNECTION_DEACTIVATED] =
|
||||
g_signal_new ("connection-deactivated",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0, NULL, NULL,
|
||||
_nm_marshal_VOID__OBJECT_UINT_UINT_UINT,
|
||||
G_TYPE_NONE, 4, G_TYPE_OBJECT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
|
||||
|
||||
dbus_g_error_domain_register (NM_VPN_MANAGER_ERROR, NULL, NM_TYPE_VPN_MANAGER_ERROR);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,16 +53,6 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
GObjectClass parent;
|
||||
|
||||
/* Signals */
|
||||
void (*connection_activated) (NMVPNManager *manager,
|
||||
NMVPNConnection *connection);
|
||||
|
||||
void (*connection_deactivated) (NMVPNManager *manager,
|
||||
NMVPNConnection *connection,
|
||||
NMVPNConnectionState new_state,
|
||||
NMVPNConnectionState old_state,
|
||||
NMVPNConnectionStateReason reason);
|
||||
} NMVPNManagerClass;
|
||||
|
||||
GType nm_vpn_manager_get_type (void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue