[gnome-builder] paths: prefer project id to project name



commit d2056268bf34d77ea75d247ff7fe3e8dd66752a1
Author: Christian Hergert <chergert redhat com>
Date:   Wed Aug 24 12:11:50 2016 -0700

    paths: prefer project id to project name
    
    Project names are for display and can contain interesting characters such
    as spaces. Build systems (especially Make based) really dont like spaces.

 libide/runtimes/ide-runtime.c             |    6 +++---
 plugins/autotools/ide-autotools-builder.c |    6 +++---
 plugins/autotools/ide-makecache.c         |   12 ++++++------
 plugins/flatpak/gbp-flatpak-runtime.c     |    2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/libide/runtimes/ide-runtime.c b/libide/runtimes/ide-runtime.c
index b9fff8e..a27948a 100644
--- a/libide/runtimes/ide-runtime.c
+++ b/libide/runtimes/ide-runtime.c
@@ -150,19 +150,19 @@ ide_runtime_real_prepare_configuration (IdeRuntime       *self,
   g_autofree gchar *install_path = NULL;
   IdeContext *context;
   IdeProject *project;
-  const gchar *project_name;
+  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_name = ide_project_get_name (project);
+  project_id = ide_project_get_id (project);
 
   install_path = g_build_filename (g_get_user_cache_dir (),
                                    "gnome-builder",
                                    "install",
-                                   project_name,
+                                   project_id,
                                    priv->id,
                                    NULL);
 
diff --git a/plugins/autotools/ide-autotools-builder.c b/plugins/autotools/ide-autotools-builder.c
index b6d0a41..9efbbbe 100644
--- a/plugins/autotools/ide-autotools-builder.c
+++ b/plugins/autotools/ide-autotools-builder.c
@@ -73,7 +73,7 @@ ide_autotools_builder_get_build_directory (IdeAutotoolsBuilder *self)
   IdeProject *project;
   IdeDevice *device;
   const gchar *root_build_dir;
-  const gchar *project_name;
+  const gchar *project_id;
   const gchar *device_id;
   const gchar *system_type;
 
@@ -120,8 +120,8 @@ ide_autotools_builder_get_build_directory (IdeAutotoolsBuilder *self)
   project = ide_context_get_project (context);
   root_build_dir = ide_context_get_root_build_dir (context);
   system_type = ide_device_get_system_type (device);
-  project_name = ide_project_get_name (project);
-  path = g_build_filename (root_build_dir, project_name, device_id, system_type, NULL);
+  project_id = ide_project_get_id (project);
+  path = g_build_filename (root_build_dir, project_id, device_id, system_type, NULL);
 
   return g_file_new_for_path (path);
 }
diff --git a/plugins/autotools/ide-makecache.c b/plugins/autotools/ide-makecache.c
index 5bb7284..14bd650 100644
--- a/plugins/autotools/ide-makecache.c
+++ b/plugins/autotools/ide-makecache.c
@@ -441,7 +441,7 @@ ide_makecache_open_temp (IdeMakecache  *self,
 {
   IdeContext *context;
   IdeProject *project;
-  const gchar *project_name;
+  const gchar *project_id;
   g_autofree gchar *name = NULL;
   g_autofree gchar *path = NULL;
   g_autofree gchar *directory = NULL;
@@ -457,7 +457,7 @@ ide_makecache_open_temp (IdeMakecache  *self,
 
   context = ide_object_get_context (IDE_OBJECT (self));
   project = ide_context_get_project (context);
-  project_name = ide_project_get_name (project);
+  project_id = ide_project_get_id (project);
 
   directory = g_build_filename (g_get_user_cache_dir (),
                                 ide_get_program_name (),
@@ -476,7 +476,7 @@ ide_makecache_open_temp (IdeMakecache  *self,
     }
 
   now = time (NULL);
-  name = g_strdup_printf ("%s.makecache.tmp-%u", project_name, (guint)now);
+  name = g_strdup_printf ("%s.makecache.tmp-%u", project_id, (guint)now);
   path = g_build_filename (directory, name, NULL);
 
   g_debug ("Creating temporary makecache at \"%s\"", path);
@@ -508,7 +508,7 @@ ide_makecache_new_worker (GTask        *task,
   IdeMakecache *self = source_object;
   IdeContext *context;
   IdeProject *project;
-  const gchar *project_name;
+  const gchar *project_id;
   g_autofree gchar *name_used = NULL;
   g_autofree gchar *name = NULL;
   g_autofree gchar *cache_path = NULL;
@@ -549,8 +549,8 @@ ide_makecache_new_worker (GTask        *task,
 
   context = ide_object_get_context (IDE_OBJECT (self));
   project = ide_context_get_project (context);
-  project_name = ide_project_get_name (project);
-  name = g_strdup_printf ("%s.makecache", project_name);
+  project_id = ide_project_get_id (project);
+  name = g_strdup_printf ("%s.makecache", project_id);
   cache_path = g_build_filename (g_get_user_cache_dir (),
                                  ide_get_program_name (),
                                  "makecache",
diff --git a/plugins/flatpak/gbp-flatpak-runtime.c b/plugins/flatpak/gbp-flatpak-runtime.c
index 9dedb45..e8e35bc 100644
--- a/plugins/flatpak/gbp-flatpak-runtime.c
+++ b/plugins/flatpak/gbp-flatpak-runtime.c
@@ -53,7 +53,7 @@ get_build_directory (GbpFlatpakRuntime *self)
   return g_build_filename (g_get_user_cache_dir (),
                            "gnome-builder",
                            "builds",
-                           ide_project_get_name (project),
+                           ide_project_get_id (project),
                            "flatpak",
                            ide_runtime_get_id (IDE_RUNTIME (self)),
                            NULL);


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