[gnome-builder] libide-foundry: port IdeDiagnosticTool to run context



commit a86ebc85c67ef6b0b3236ba16f1f43969198cee0
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 11 21:09:05 2022 -0700

    libide-foundry: port IdeDiagnosticTool to run context

 src/libide/foundry/ide-diagnostic-tool.c | 13 ++++++++-----
 src/libide/foundry/ide-diagnostic-tool.h | 14 +++++++-------
 2 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/libide/foundry/ide-diagnostic-tool.c b/src/libide/foundry/ide-diagnostic-tool.c
index 43a6a6ec7..c3c9ac74b 100644
--- a/src/libide/foundry/ide-diagnostic-tool.c
+++ b/src/libide/foundry/ide-diagnostic-tool.c
@@ -27,6 +27,7 @@
 #include "ide-build-manager.h"
 #include "ide-diagnostic-tool.h"
 #include "ide-pipeline.h"
+#include "ide-run-context.h"
 #include "ide-runtime.h"
 #include "ide-runtime-manager.h"
 
@@ -170,7 +171,7 @@ ide_diagnostic_tool_real_create_launcher (IdeDiagnosticTool  *self,
       ((program_path != NULL && ide_pipeline_contains_program_in_path (pipeline, program_path, NULL)) ||
       ide_pipeline_contains_program_in_path (pipeline, program_name, NULL)) &&
       (launcher = ide_pipeline_create_launcher (pipeline, NULL)))
-    goto setup_launcher;
+    IDE_GOTO (setup_launcher);
 
   if (host != NULL)
     {
@@ -182,15 +183,17 @@ ide_diagnostic_tool_real_create_launcher (IdeDiagnosticTool  *self,
       if (program_path != NULL ||
           ide_runtime_contains_program_in_path (host, program_name, NULL))
         {
-          launcher = ide_runtime_create_launcher (host, NULL);
-          goto setup_launcher;
+          g_autoptr(IdeRunContext) run_context = ide_run_context_new ();
+          ide_run_context_push_host (run_context);
+          launcher = ide_run_context_end (run_context, NULL);
+          IDE_GOTO (setup_launcher);
         }
     }
   else if (program_path != NULL)
     {
       launcher = ide_subprocess_launcher_new (0);
       ide_subprocess_launcher_set_run_on_host (launcher, TRUE);
-      goto setup_launcher;
+      IDE_GOTO (setup_launcher);
     }
 
   if (bundled_program_path != NULL && ide_is_flatpak ())
@@ -200,7 +203,7 @@ ide_diagnostic_tool_real_create_launcher (IdeDiagnosticTool  *self,
   if (program_path || g_find_program_in_path (program_name))
     {
       launcher = ide_subprocess_launcher_new (0);
-      goto setup_launcher;
+      IDE_GOTO (setup_launcher);
     }
 
   g_set_error (error,
diff --git a/src/libide/foundry/ide-diagnostic-tool.h b/src/libide/foundry/ide-diagnostic-tool.h
index fe8e3a8c8..cedb50927 100644
--- a/src/libide/foundry/ide-diagnostic-tool.h
+++ b/src/libide/foundry/ide-diagnostic-tool.h
@@ -28,7 +28,7 @@ G_BEGIN_DECLS
 
 #define IDE_TYPE_DIAGNOSTIC_TOOL (ide_diagnostic_tool_get_type())
 
-IDE_AVAILABLE_IN_42
+IDE_AVAILABLE_IN_ALL
 G_DECLARE_DERIVABLE_TYPE (IdeDiagnosticTool, ide_diagnostic_tool, IDE, DIAGNOSTIC_TOOL, IdeObject)
 
 struct _IdeDiagnosticToolClass
@@ -61,19 +61,19 @@ struct _IdeDiagnosticToolClass
                                                   const char             *language_id);
 };
 
-IDE_AVAILABLE_IN_42
+IDE_AVAILABLE_IN_ALL
 const char *ide_diagnostic_tool_get_program_name         (IdeDiagnosticTool *self);
-IDE_AVAILABLE_IN_42
+IDE_AVAILABLE_IN_ALL
 void        ide_diagnostic_tool_set_program_name         (IdeDiagnosticTool *self,
                                                           const char        *program_name);
-IDE_AVAILABLE_IN_43
+IDE_AVAILABLE_IN_ALL
 const char *ide_diagnostic_tool_get_bundled_program_path (IdeDiagnosticTool *self);
-IDE_AVAILABLE_IN_43
+IDE_AVAILABLE_IN_ALL
 void        ide_diagnostic_tool_set_bundled_program_path (IdeDiagnosticTool *self,
                                                           const char        *path);
-IDE_AVAILABLE_IN_43
+IDE_AVAILABLE_IN_ALL
 const char *ide_diagnostic_tool_get_local_program_path   (IdeDiagnosticTool *self);
-IDE_AVAILABLE_IN_43
+IDE_AVAILABLE_IN_ALL
 void        ide_diagnostic_tool_set_local_program_path   (IdeDiagnosticTool *self,
                                                           const char        *path);
 


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