[gimp] app: try to store plug-in paths in terms of ${gimp_plug_in_dir}
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: try to store plug-in paths in terms of ${gimp_plug_in_dir}
- Date: Wed, 31 Aug 2016 20:06:18 +0000 (UTC)
commit 9f343f25ebea06078bd829144fc65cd35fe210fa
Author: Michael Natterer <mitch gimp org>
Date: Wed Aug 31 22:04:46 2016 +0200
app: try to store plug-in paths in terms of ${gimp_plug_in_dir}
so they get found without re-querying by relocatable GIMP packages.
app/plug-in/plug-in-rc.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/app/plug-in/plug-in-rc.c b/app/plug-in/plug-in-rc.c
index 18146c3..80e77b1 100644
--- a/app/plug-in/plug-in-rc.c
+++ b/app/plug-in/plug-in-rc.c
@@ -793,6 +793,8 @@ plug_in_rc_write (GSList *plug_in_defs,
{
GimpConfigWriter *writer;
GEnumClass *enum_class;
+ const gchar *plug_in_dir;
+ gint plug_in_dir_length;
GSList *list;
writer = gimp_config_writer_new_gfile (file,
@@ -807,6 +809,9 @@ plug_in_rc_write (GSList *plug_in_defs,
enum_class = g_type_class_ref (GIMP_TYPE_ICON_TYPE);
+ plug_in_dir = gimp_plug_in_directory ();
+ plug_in_dir_length = strlen (plug_in_dir);
+
gimp_config_writer_open (writer, "protocol-version");
gimp_config_writer_printf (writer, "%d", GIMP_PROTOCOL_VERSION);
gimp_config_writer_close (writer);
@@ -828,6 +833,20 @@ plug_in_rc_write (GSList *plug_in_defs,
gchar *utf8;
path = g_file_get_path (plug_in_def->file);
+
+ /* if possible, replace the beginning of path with a literal
+ * "${gimp_plug_in_dir}", to help things like app bundles
+ * which are mounted at random temo locations.
+ */
+ if (g_str_has_prefix (path, plug_in_dir))
+ {
+ gchar *tmp = g_strconcat ("${gimp_plug_in_dir}",
+ path + plug_in_dir_length,
+ NULL);
+ g_free (path);
+ path = tmp;
+ }
+
utf8 = g_filename_to_utf8 (path, -1, NULL, NULL, NULL);
g_free (path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]