aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-plugin-huawei.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-06-02 12:33:09 +0200
committerAleksander Morgado <aleksander@lanedo.com>2011-06-06 17:21:47 +0200
commitf9f6d1dfdb070bec05e5e7385f8d4eb95e573b6f (patch)
tree07e29bd3e00f8a4763e1075e5bda2162ec863f42 /plugins/mm-plugin-huawei.c
parent39215599018a12817a853615ccbc4ee67c234858 (diff)
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.
Diffstat (limited to 'plugins/mm-plugin-huawei.c')
-rw-r--r--plugins/mm-plugin-huawei.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/mm-plugin-huawei.c b/plugins/mm-plugin-huawei.c
index aef3c524..285394b9 100644
--- a/plugins/mm-plugin-huawei.c
+++ b/plugins/mm-plugin-huawei.c
@@ -133,7 +133,6 @@ supports_port (MMPluginBase *base,
MMPluginBaseSupportsTask *task)
{
GUdevDevice *port;
- guint32 cached = 0, level;
const char *subsys, *name;
int usbif;
guint16 vendor = 0, product = 0;
@@ -168,8 +167,12 @@ supports_port (MMPluginBase *base,
if (!existing && usbif != 0)
return MM_PLUGIN_SUPPORTS_PORT_DEFER;
- 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;