[gnome-builder] libide/foundry: add setters for build/clean command properties



commit 98f115a95eb7e164a400eba8107ac776a82b4a6a
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 15 16:45:38 2022 -0700

    libide/foundry: add setters for build/clean command properties

 src/libide/foundry/ide-pipeline-stage-command.c | 22 ++++++++++++++++++++++
 src/libide/foundry/ide-pipeline-stage-command.h | 10 ++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/foundry/ide-pipeline-stage-command.c b/src/libide/foundry/ide-pipeline-stage-command.c
index 7dec06a60..4a41b6368 100644
--- a/src/libide/foundry/ide-pipeline-stage-command.c
+++ b/src/libide/foundry/ide-pipeline-stage-command.c
@@ -315,3 +315,25 @@ ide_pipeline_stage_command_new (IdeRunCommand *build_command,
                        "clean-command", clean_command,
                        NULL);
 }
+
+void
+ide_pipeline_stage_command_set_build_command (IdePipelineStageCommand *self,
+                                              IdeRunCommand           *build_command)
+{
+  g_return_if_fail (IDE_IS_PIPELINE_STAGE_COMMAND (self));
+  g_return_if_fail (!build_command || IDE_IS_RUN_COMMAND (build_command));
+
+  if (g_set_object (&self->build_command, build_command))
+    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BUILD_COMMAND]);
+}
+
+void
+ide_pipeline_stage_command_set_clean_command (IdePipelineStageCommand *self,
+                                              IdeRunCommand           *clean_command)
+{
+  g_return_if_fail (IDE_IS_PIPELINE_STAGE_COMMAND (self));
+  g_return_if_fail (!clean_command || IDE_IS_RUN_COMMAND (clean_command));
+
+  if (g_set_object (&self->clean_command, clean_command))
+    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CLEAN_COMMAND]);
+}
diff --git a/src/libide/foundry/ide-pipeline-stage-command.h b/src/libide/foundry/ide-pipeline-stage-command.h
index 36003634d..83fa24186 100644
--- a/src/libide/foundry/ide-pipeline-stage-command.h
+++ b/src/libide/foundry/ide-pipeline-stage-command.h
@@ -37,7 +37,13 @@ IDE_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (IdePipelineStageCommand, ide_pipeline_stage_command, IDE, PIPELINE_STAGE_COMMAND, 
IdePipelineStage)
 
 IDE_AVAILABLE_IN_ALL
-IdePipelineStage *ide_pipeline_stage_command_new (IdeRunCommand *build_command,
-                                                  IdeRunCommand *clean_command);
+IdePipelineStage *ide_pipeline_stage_command_new               (IdeRunCommand *build_command,
+                                                                IdeRunCommand *clean_command);
+IDE_AVAILABLE_IN_ALL
+void              ide_pipeline_stage_command_set_build_command (IdePipelineStageCommand *self,
+                                                                IdeRunCommand           *build_command);
+IDE_AVAILABLE_IN_ALL
+void              ide_pipeline_stage_command_set_clean_command (IdePipelineStageCommand *self,
+                                                                IdeRunCommand           *clean_command);
 
 G_END_DECLS


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