[gimp] libgimpconfig: new API gimp_config_build_system_path().



commit 9c05f103689696d3bc6e98e5e43501e20bb19787
Author: Jehan <jehan girinstud io>
Date:   Mon Jul 2 13:18:20 2018 +0200

    libgimpconfig: new API gimp_config_build_system_path().
    
    This is the complementary of gimp_config_build_writable_path() to
    properly get the system vs. user directories.

 libgimpconfig/gimpconfig-path.c | 21 +++++++++++++++++++++
 libgimpconfig/gimpconfig-path.h |  1 +
 2 files changed, 22 insertions(+)
---
diff --git a/libgimpconfig/gimpconfig-path.c b/libgimpconfig/gimpconfig-path.c
index 040f8c4381..2ea32fcb2b 100644
--- a/libgimpconfig/gimpconfig-path.c
+++ b/libgimpconfig/gimpconfig-path.c
@@ -267,6 +267,27 @@ gimp_config_build_writable_path (const gchar *name)
   return g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, name, NULL);
 }
 
+/**
+ * gimp_config_build_system_path:
+ * @name: directory name (in UTF-8 encoding)
+ *
+ * Creates a search path as it is used in the gimprc file.  The path
+ * returned by gimp_config_build_system_path() is just the read-only
+ * parts of the search path constructed by gimp_config_build_plug_in_path().
+ *
+ * Note that you cannot use this path directly with gimp_path_parse().
+ * As it is in the gimprc notation, you first need to expand and
+ * recode it using gimp_config_path_expand().
+ *
+ * Returns: a newly allocated string
+ *
+ * Since: 2.10.6
+ **/
+gchar *
+gimp_config_build_system_path (const gchar *name)
+{
+  return g_strconcat ("${gimp_plug_in_dir}", G_DIR_SEPARATOR_S, name, NULL);
+}
 
 /**
  * gimp_config_path_expand:
diff --git a/libgimpconfig/gimpconfig-path.h b/libgimpconfig/gimpconfig-path.h
index eae987211f..e748c1cb09 100644
--- a/libgimpconfig/gimpconfig-path.h
+++ b/libgimpconfig/gimpconfig-path.h
@@ -92,6 +92,7 @@ gchar             * gimp_file_get_config_path        (GFile        *file,
 gchar             * gimp_config_build_data_path      (const gchar  *name) G_GNUC_MALLOC;
 gchar             * gimp_config_build_writable_path  (const gchar  *name) G_GNUC_MALLOC;
 gchar             * gimp_config_build_plug_in_path   (const gchar  *name) G_GNUC_MALLOC;
+gchar             * gimp_config_build_system_path    (const gchar  *name) G_GNUC_MALLOC;
 
 
 G_END_DECLS


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