From ed2b32c6829ad6ed9310f2f76047a6dc2e12d9dd Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 19 Feb 2013 12:45:10 +0100 Subject: plugin-manager: if minimum time consumed and all deferred tasks, abort probing For the case where we just get a device with all net ports (i.e. all deferred until result suggested), just abort the probing if the minimum probing time is consumed. --- src/mm-plugin-manager.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c index 82c784a2..940990e3 100644 --- a/src/mm-plugin-manager.c +++ b/src/mm-plugin-manager.c @@ -561,8 +561,29 @@ min_probing_timeout_cb (FindDeviceSupportContext *ctx) /* If there are no running probes around, we're free to finish */ if (ctx->running_probes == NULL) { - mm_dbg ("(Plugin Manager) Minimum probing time consumed and no more ports to probe"); + mm_dbg ("(Plugin Manager) [%s] Minimum probing time consumed and no more ports to probe", + mm_device_get_path (ctx->device)); find_device_support_context_complete_and_free (ctx); + } else { + GList *l; + gboolean not_deferred = FALSE; + + mm_dbg ("(Plugin Manager) [%s] Minimum probing time consumed", + mm_device_get_path (ctx->device)); + + /* If all we got were probes with 'deferred_until_suggested', just cancel + * the probing. May happen e.g. with just 'net' ports */ + for (l = ctx->running_probes; l; l = g_list_next (l)) { + PortProbeContext *port_probe_ctx = l->data; + + if (!port_probe_ctx->defer_until_suggested) { + not_deferred = TRUE; + break; + } + } + + if (!not_deferred) + suggest_port_probe_result (ctx, NULL, NULL); } return FALSE; -- cgit v1.2.3-70-g09d2