[gnome-builder/gnome-builder-3-40] deviced: Override finish functions



commit efdefcf20209468245898565ed1d8d561c618c24
Author: James Westman <james jwestman net>
Date:   Wed Apr 21 22:37:50 2021 -0500

    deviced: Override finish functions
    
    The async vfuncs were overridden, but not the finish functions. This
    caused a crash when using the "deploy" action because the default
    methods uses GTask while the overridden ones use IdeTask.

 src/plugins/deviced/gbp-deviced-deploy-strategy.c | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)
---
diff --git a/src/plugins/deviced/gbp-deviced-deploy-strategy.c 
b/src/plugins/deviced/gbp-deviced-deploy-strategy.c
index 81cefc48f..77eda6f72 100644
--- a/src/plugins/deviced/gbp-deviced-deploy-strategy.c
+++ b/src/plugins/deviced/gbp-deviced-deploy-strategy.c
@@ -97,6 +97,17 @@ gbp_deviced_deploy_strategy_load_async (IdeDeployStrategy   *strategy,
   IDE_EXIT;
 }
 
+static gboolean
+gbp_deviced_deploy_strategy_load_finish (IdeDeployStrategy *self,
+                                         GAsyncResult *result,
+                                         GError **error)
+{
+  g_return_val_if_fail (GBP_IS_DEVICED_DEPLOY_STRATEGY (self), FALSE);
+  g_return_val_if_fail (ide_task_is_valid (result, self), FALSE);
+
+  return ide_task_propagate_boolean (IDE_TASK (result), error);
+}
+
 static void
 deploy_install_bundle_cb (GObject      *object,
                           GAsyncResult *result,
@@ -357,13 +368,26 @@ gbp_deviced_deploy_strategy_deploy_async (IdeDeployStrategy     *strategy,
   IDE_EXIT;
 }
 
+static gboolean
+gbp_deviced_deploy_strategy_deploy_finish (IdeDeployStrategy *self,
+                                           GAsyncResult *result,
+                                           GError **error)
+{
+  g_return_val_if_fail (GBP_IS_DEVICED_DEPLOY_STRATEGY (self), FALSE);
+  g_return_val_if_fail (ide_task_is_valid (result, self), FALSE);
+
+  return ide_task_propagate_boolean (IDE_TASK (result), error);
+}
+
 static void
 gbp_deviced_deploy_strategy_class_init (GbpDevicedDeployStrategyClass *klass)
 {
   IdeDeployStrategyClass *strategy_class = IDE_DEPLOY_STRATEGY_CLASS (klass);
 
   strategy_class->load_async = gbp_deviced_deploy_strategy_load_async;
+  strategy_class->load_finish = gbp_deviced_deploy_strategy_load_finish;
   strategy_class->deploy_async = gbp_deviced_deploy_strategy_deploy_async;
+  strategy_class->deploy_finish = gbp_deviced_deploy_strategy_deploy_finish;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]