device: split `MMDevice' creation and plugin setting

We want to be able to create the MMDevice way before we have decided which
plugin to use.
This commit is contained in:
Aleksander Morgado
2012-07-10 07:00:46 +02:00
parent 815693661c
commit 0aff871b04
3 changed files with 20 additions and 10 deletions

View File

@@ -173,8 +173,8 @@ find_port_support_ready_cb (MMPluginManager *plugin_manager,
if (!device) {
/* Create a generic device to track the available ports, and add it to the
* manager. */
device = mm_device_new (ctx->physical_device,
best_plugin);
device = mm_device_new (ctx->physical_device);
mm_device_set_plugin (device, best_plugin);
g_hash_table_insert (ctx->manager->priv->devices,
g_strdup (g_udev_device_get_sysfs_path (mm_device_peek_udev_device (device))),
device);