From f9f6d1dfdb070bec05e5e7385f8d4eb95e573b6f Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 2 Jun 2011 12:33:09 +0200 Subject: plugins: propagate cached probing result to supports task We need to ensure that the supports task always has the results of the probing, no matter if the probing was just launched by the plugin grabbing the port, or by a previous plugin. We do this during supports_port(), by propagating to the supports task any possible previously cached probing results. --- plugins/mm-plugin-hso.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'plugins/mm-plugin-hso.c') diff --git a/plugins/mm-plugin-hso.c b/plugins/mm-plugin-hso.c index a0958029..60d9863b 100644 --- a/plugins/mm-plugin-hso.c +++ b/plugins/mm-plugin-hso.c @@ -62,7 +62,6 @@ supports_port (MMPluginBase *base, MMPluginBaseSupportsTask *task) { GUdevDevice *port; - guint32 cached = 0, level; const char *driver, *subsys; port = mm_plugin_base_supports_task_get_port (task); @@ -78,8 +77,12 @@ supports_port (MMPluginBase *base, return MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS; } - if (mm_plugin_base_get_cached_port_capabilities (base, port, &cached)) { - level = get_level_for_capabilities (cached); + /* Check if a previous probing was already launched in this port */ + if (mm_plugin_base_supports_task_propagate_cached (task)) { + guint32 level; + + /* A previous probing was already done, use its results */ + level = get_level_for_capabilities (mm_plugin_base_supports_task_get_probed_capabilities (task)); if (level) { mm_plugin_base_supports_task_complete (task, level); return MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS; -- cgit v1.2.3-70-g09d2