diff options
Diffstat (limited to 'src/nm-connection-provider.c')
| -rw-r--r-- | src/nm-connection-provider.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/nm-connection-provider.c b/src/nm-connection-provider.c index 51caf400..8185b8c6 100644 --- a/src/nm-connection-provider.c +++ b/src/nm-connection-provider.c @@ -18,6 +18,8 @@ #include "nm-connection-provider.h" #include "nm-utils.h" +G_DEFINE_INTERFACE (NMConnectionProvider, nm_connection_provider, G_TYPE_OBJECT) + GSList * nm_connection_provider_get_best_connections (NMConnectionProvider *self, guint max_requested, @@ -91,7 +93,7 @@ nm_connection_provider_get_connection_by_uuid (NMConnectionProvider *self, /*****************************************************************************/ static void -nm_connection_provider_init (gpointer g_iface) +nm_connection_provider_default_init (NMConnectionProviderInterface *g_iface) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); static gboolean initialized = FALSE; @@ -104,7 +106,7 @@ nm_connection_provider_init (gpointer g_iface) g_signal_new (NM_CP_SIGNAL_CONNECTION_ADDED, iface_type, G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMConnectionProvider, connection_added), + G_STRUCT_OFFSET (NMConnectionProviderInterface, connection_added), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); @@ -112,7 +114,7 @@ nm_connection_provider_init (gpointer g_iface) g_signal_new (NM_CP_SIGNAL_CONNECTION_UPDATED, iface_type, G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMConnectionProvider, connection_updated), + G_STRUCT_OFFSET (NMConnectionProviderInterface, connection_updated), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); @@ -120,33 +122,8 @@ nm_connection_provider_init (gpointer g_iface) g_signal_new (NM_CP_SIGNAL_CONNECTION_REMOVED, iface_type, G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMConnectionProvider, connection_removed), + G_STRUCT_OFFSET (NMConnectionProviderInterface, connection_removed), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); } - -GType -nm_connection_provider_get_type (void) -{ - static GType cp_type = 0; - - if (!G_UNLIKELY (cp_type)) { - const GTypeInfo cp_info = { - sizeof (NMConnectionProvider), /* class_size */ - nm_connection_provider_init, /* base_init */ - NULL, /* base_finalize */ - NULL, - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, - 0, /* n_preallocs */ - NULL - }; - - cp_type = g_type_register_static (G_TYPE_INTERFACE, "NMConnectionProvider", &cp_info, 0); - g_type_interface_add_prerequisite (cp_type, G_TYPE_OBJECT); - } - - return cp_type; -} |