aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-manager.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-01-05 01:30:08 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:45 +0100
commit32a0c8fbb7d5fa76e963aec2e288a0e2dcc214a4 (patch)
tree2f3ba92e2d93ce8c1613798cc7d3153ab4260109 /src/mm-plugin-manager.c
parent65c14607cd8233217116e19e7c30067257a6f03c (diff)
plugin-manager: new defer-until-suggested support check result handling
'net' ports will be supported as soon as there is another port reporting successful support.
Diffstat (limited to 'src/mm-plugin-manager.c')
-rw-r--r--src/mm-plugin-manager.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c
index 5cba7711..3218a2c6 100644
--- a/src/mm-plugin-manager.c
+++ b/src/mm-plugin-manager.c
@@ -271,6 +271,30 @@ supports_port_ready_cb (MMPlugin *plugin,
(GSourceFunc)find_port_support_idle,
info);
break;
+
+ case MM_PLUGIN_SUPPORTS_PORT_DEFER_UNTIL_SUGGESTED:
+ /* We were told to defer until getting a suggested plugin, and we already
+ * got one here, so we're done. */
+ if (info->suggested_plugin) {
+ mm_dbg ("(%s): (%s) support check finished, got suggested",
+ mm_plugin_get_name (MM_PLUGIN (info->suggested_plugin)),
+ info->name);
+ info->best_plugin = info->suggested_plugin;
+ info->current = NULL;
+
+ /* Schedule checking support, which will end the operation */
+ info->source_id = g_idle_add ((GSourceFunc)find_port_support_idle,
+ info);
+ } else {
+ mm_dbg ("(%s): (%s) deferring support check until result suggested",
+ mm_plugin_get_name (MM_PLUGIN (info->current->data)),
+ info->name);
+ /* Schedule checking support */
+ info->source_id = g_timeout_add_seconds (SUPPORTS_DEFER_TIMEOUT_SECS,
+ (GSourceFunc)find_port_support_idle,
+ info);
+ }
+ break;
}
}
@@ -673,4 +697,3 @@ mm_plugin_manager_class_init (MMPluginManagerClass *manager_class)
/* Virtual methods */
object_class->finalize = finalize;
}
-