From 8312bf270b08afa2df666fe177b6c42fee777574 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Fri, 4 Mar 2005 16:27:59 +0000 Subject: [PATCH] need to convert script-fu-path to filesystem encoding. Should fix bug 2005-03-04 Sven Neumann * plug-ins/script-fu/script-fu-scripts.c (script_fu_find_scripts): need to convert script-fu-path to filesystem encoding. Should fix bug #165002. --- ChangeLog | 6 ++++++ plug-ins/script-fu/script-fu-scripts.c | 21 ++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51d8ad41b8..c9512772ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-03-04 Sven Neumann + + * plug-ins/script-fu/script-fu-scripts.c (script_fu_find_scripts): + need to convert script-fu-path to filesystem encoding. Should fix + bug #165002. + 2005-03-04 Sven Neumann * plug-ins/common/*: ported to gstdio, removed unnecessary includes. diff --git a/plug-ins/script-fu/script-fu-scripts.c b/plug-ins/script-fu/script-fu-scripts.c index 457e0497f7..d1de943db2 100644 --- a/plug-ins/script-fu/script-fu-scripts.c +++ b/plug-ins/script-fu/script-fu-scripts.c @@ -94,7 +94,9 @@ static GList *script_menu_list = NULL; void script_fu_find_scripts (void) { - gchar *path_str; + gchar *path_str; + gchar *path; + GError *error = NULL; /* Make sure to clear any existing scripts */ if (script_tree != NULL) @@ -109,15 +111,24 @@ script_fu_find_scripts (void) path_str = gimp_gimprc_query ("script-fu-path"); - if (path_str == NULL) + if (! path_str) return; - gimp_datafiles_read_directories (path_str, G_FILE_TEST_IS_REGULAR, + path = g_filename_from_utf8 (path_str, -1, NULL, NULL, &error); + g_free (path_str); + + if (! path) + { + g_warning ("Can't convert script-fu-path to filesystem encoding: %s", + error->message); + g_error_free (error); + return; + } + + gimp_datafiles_read_directories (path, G_FILE_TEST_IS_REGULAR, script_fu_load_script, NULL); - g_free (path_str); - /* Now that all scripts are read in and sorted, tell gimp about them */ g_tree_foreach (script_tree, (GTraverseFunc) script_fu_install_script,