[gnome-builder/wip/chergert/pipeline-merge] runtime: only set prefix if not already set



commit dbc30a5294f73b2e038a6d8262855bf9485df362
Author: Christian Hergert <chergert redhat com>
Date:   Fri Feb 10 23:40:44 2017 -0800

    runtime: only set prefix if not already set

 libide/runtimes/ide-runtime.c |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/libide/runtimes/ide-runtime.c b/libide/runtimes/ide-runtime.c
index 104040b..0e5294f 100644
--- a/libide/runtimes/ide-runtime.c
+++ b/libide/runtimes/ide-runtime.c
@@ -106,26 +106,30 @@ ide_runtime_real_prepare_configuration (IdeRuntime       *self,
                                         IdeConfiguration *configuration)
 {
   IdeRuntimePrivate *priv = ide_runtime_get_instance_private (self);
-  g_autofree gchar *install_path = NULL;
-  IdeContext *context;
-  IdeProject *project;
-  const gchar *project_id;
 
   g_assert (IDE_IS_RUNTIME (self));
   g_assert (IDE_IS_CONFIGURATION (configuration));
 
-  context = ide_object_get_context (IDE_OBJECT (self));
-  project = ide_context_get_project (context);
-  project_id = ide_project_get_id (project);
-
-  install_path = g_build_filename (g_get_user_cache_dir (),
-                                   "gnome-builder",
-                                   "install",
-                                   project_id,
-                                   priv->id,
-                                   NULL);
-
-  ide_configuration_set_prefix (configuration, install_path);
+  if (NULL == ide_configuration_get_prefix (configuration))
+    {
+      g_autofree gchar *install_path = NULL;
+      IdeContext *context;
+      IdeProject *project;
+      const gchar *project_id;
+
+      context = ide_object_get_context (IDE_OBJECT (self));
+      project = ide_context_get_project (context);
+      project_id = ide_project_get_id (project);
+
+      install_path = g_build_filename (g_get_user_cache_dir (),
+                                       "gnome-builder",
+                                       "install",
+                                       project_id,
+                                       priv->id,
+                                       NULL);
+
+      ide_configuration_set_prefix (configuration, install_path);
+    }
 }
 
 static IdeRunner *


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