[gnome-builder/wip/chergert/pipeline-merge] build-pipeline: allow delayed initialization of pipeline



commit fb169991d81f5bb99ce7af6057313b65d4f11ee5
Author: Christian Hergert <chergert redhat com>
Date:   Fri Feb 10 17:08:18 2017 -0800

    build-pipeline: allow delayed initialization of pipeline
    
    This allows us to create the object, and then delay the initialization
    until later as needed by the build manager to locate the build runtime.

 libide/buildsystem/ide-build-pipeline.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libide/buildsystem/ide-build-pipeline.c b/libide/buildsystem/ide-build-pipeline.c
index 3ae2791..b5a9df1 100644
--- a/libide/buildsystem/ide-build-pipeline.c
+++ b/libide/buildsystem/ide-build-pipeline.c
@@ -185,6 +185,11 @@ struct _IdeBuildPipeline
   guint seqnum;
 
   /*
+   * If GInitableIface.init has been called.
+   */
+  guint initialized : 1;
+
+  /*
    * If we failed to build, this should be set.
    */
   guint failed : 1;
@@ -834,6 +839,8 @@ ide_build_pipeline_initable_init (GInitable     *initable,
   g_assert (IDE_IS_BUILD_PIPELINE (self));
   g_assert (IDE_IS_CONFIGURATION (self->configuration));
 
+  self->initialized = TRUE;
+
   g_signal_connect_object (self->configuration,
                            "notify::ready",
                            G_CALLBACK (ide_build_pipeline_notify_ready),
@@ -845,6 +852,8 @@ ide_build_pipeline_initable_init (GInitable     *initable,
   else
     g_message ("Configuration not ready, delaying pipeline setup");
 
+  ide_build_pipeline_queue_flush (self);
+
   IDE_RETURN (TRUE);
 }
 
@@ -1263,6 +1272,12 @@ ide_build_pipeline_do_flush (gpointer data)
   g_assert (IDE_IS_BUILD_PIPELINE (self));
 
   /*
+   * If we have not yet initialized, there is nothing we can do.
+   */
+  if (!self->initialized)
+    IDE_RETURN (G_SOURCE_REMOVE);
+
+  /*
    * If the busy bit is set, there is nothing to do right now.
    */
   if (self->busy)


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