diff options
author | Aleksander Morgado <aleksander@gnu.org> | 2011-09-18 22:55:47 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:21 +0100 |
commit | db356bb20b5969c9680e9f11e21ad9bc51be30ec (patch) | |
tree | 4687a0e89fb772003cf36a542ec2b34f8f1b69c3 | |
parent | 2588c17ad3c9c83d9992dc49d4ab1420ac38fed7 (diff) |
plugin-base: keep a MMPluginSupportsResult in the async result
Instead of just a boolean, provide a MMPluginSupportsResult, so that we can pass
it as is during `supports_port_finish()'.
-rw-r--r-- | src/mm-plugin-base.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c index 32339ecb..b9eae160 100644 --- a/src/mm-plugin-base.c +++ b/src/mm-plugin-base.c @@ -486,9 +486,15 @@ port_probe_run_ready (MMPortProbe *probe, g_simple_async_result_take_error (ctx->result, error); } else { /* Probing succeeded */ - g_simple_async_result_set_op_res_gboolean ( - ctx->result, - !apply_post_probing_filters (ctx->plugin, probe)); + MMPluginSupportsResult supports_result; + + supports_result = (apply_post_probing_filters (ctx->plugin, + probe) ? + MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED : + MM_PLUGIN_SUPPORTS_PORT_SUPPORTED); + g_simple_async_result_set_op_res_gpointer (ctx->result, + GUINT_TO_POINTER (supports_result), + NULL); } /* Complete the async supports port request */ @@ -516,12 +522,7 @@ supports_port_finish (MMPlugin *self, return MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED; } - if (g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (result))) { - *level = 10; /* dummy */ - return MM_PLUGIN_SUPPORTS_PORT_SUPPORTED; - } - - return MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED; + return (MMPluginSupportsResult) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result))); } static void @@ -595,7 +596,9 @@ supports_port (MMPlugin *plugin, &need_vendor_probing, &need_product_probing)) { /* Filtered! */ - g_simple_async_result_set_op_res_gboolean (async_result, FALSE); + g_simple_async_result_set_op_res_gpointer (async_result, + GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED), + NULL); g_simple_async_result_complete_in_idle (async_result); goto out; } |