summaryrefslogtreecommitdiff
path: root/src/devices/wifi/nm-wifi-factory.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-09-05 14:48:21 -0500
committerDan Williams <dcbw@redhat.com>2014-09-11 12:47:23 -0500
commit00fe31f5cdbfb68923960b7f75db990035f1cc25 (patch)
tree1f4b0491df68ece451429265c58ea1b944338bd5 /src/devices/wifi/nm-wifi-factory.c
parentbeb18050b5a00a704a74bff5c10919b44f087122 (diff)
core: move device factory type function into factory object
In preparation for internal device types exposing factories too, it's easier to have the device type that the factory creates be returned by the factory object instead of the plugin, because internal device types don't have plugins. This requires that we create the factory objects earlier, which further requires that any operations that trigger signals must be moved out of each factory's construction path to a separate start() function.
Diffstat (limited to 'src/devices/wifi/nm-wifi-factory.c')
-rw-r--r--src/devices/wifi/nm-wifi-factory.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/devices/wifi/nm-wifi-factory.c b/src/devices/wifi/nm-wifi-factory.c
index 5d52d66c40..bca588e6eb 100644
--- a/src/devices/wifi/nm-wifi-factory.c
+++ b/src/devices/wifi/nm-wifi-factory.c
@@ -46,20 +46,12 @@ G_DEFINE_TYPE_EXTENDED (NMWifiFactory, nm_wifi_factory, G_TYPE_OBJECT, 0,
/**************************************************************************/
-#define PLUGIN_TYPE NM_DEVICE_TYPE_WIFI
-
G_MODULE_EXPORT NMDeviceFactory *
nm_device_factory_create (GError **error)
{
return (NMDeviceFactory *) g_object_new (NM_TYPE_WIFI_FACTORY, NULL);
}
-G_MODULE_EXPORT NMDeviceType
-nm_device_factory_get_device_type (void)
-{
- return PLUGIN_TYPE;
-}
-
/**************************************************************************/
static NMDevice *
@@ -72,10 +64,17 @@ new_link (NMDeviceFactory *factory, NMPlatformLink *plink, GError **error)
return NULL;
}
+static NMDeviceType
+get_device_type (NMDeviceFactory *factory)
+{
+ return NM_DEVICE_TYPE_WIFI;
+}
+
static void
device_factory_interface_init (NMDeviceFactory *factory_iface)
{
factory_iface->new_link = new_link;
+ factory_iface->get_device_type = get_device_type;
}
static void