plug-ins/FractalExplorer/Dialogs.c plug-ins/Lighting/lighting_ui.c

2005-03-04  Sven Neumann  <sven@gimp.org>

	* plug-ins/FractalExplorer/Dialogs.c
	* plug-ins/Lighting/lighting_ui.c
	* plug-ins/gfig/gfig-dialog.c
	* plug-ins/gflare/gflare.c
	* plug-ins/gimpressionist/utils.c: same fix for path encoding as
	done in Script-Fu (see bug #165002).
This commit is contained in:
Sven Neumann 2005-03-04 17:07:34 +00:00 committed by Sven Neumann
parent ea267753f6
commit b193a98da3
6 changed files with 71 additions and 37 deletions

View File

@ -1,3 +1,12 @@
2005-03-04 Sven Neumann <sven@gimp.org>
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/Lighting/lighting_ui.c
* plug-ins/gfig/gfig-dialog.c
* plug-ins/gflare/gflare.c
* plug-ins/gimpressionist/utils.c: same fix for path encoding as
done in Script-Fu (see bug #165002).
2005-03-04 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpimage-sample-points.c

View File

@ -516,27 +516,32 @@ explorer_dialog (void)
GtkWidget *table;
GtkWidget *button;
GtkWidget *gradient;
gchar *path;
gchar *gradient_name;
GSList *group = NULL;
gint i;
gimp_ui_init ("fractalexplorer", TRUE);
fractalexplorer_path = gimp_gimprc_query ("fractalexplorer-path");
path = gimp_gimprc_query ("fractalexplorer-path");
if (! fractalexplorer_path)
if (path)
{
fractalexplorer_path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL);
g_free (path);
}
else
{
gchar *gimprc = gimp_personal_rc_file ("gimprc");
gchar *full_path;
gchar *esc_path;
full_path =
g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S,
"fractalexplorer",
G_SEARCHPATH_SEPARATOR_S,
"${gimp_data_dir}", G_DIR_SEPARATOR_S,
"fractalexplorer",
NULL);
full_path = g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S,
"fractalexplorer",
G_SEARCHPATH_SEPARATOR_S,
"${gimp_data_dir}", G_DIR_SEPARATOR_S,
"fractalexplorer",
NULL);
esc_path = g_strescape (full_path, NULL);
g_free (full_path);
@ -551,7 +556,6 @@ explorer_dialog (void)
g_free (esc_path);
}
wint.wimage = g_new (guchar, preview_width * preview_height * 3);
elements = g_new (DialogElements, 1);

View File

@ -49,7 +49,7 @@ static GtkWidget *light_type_combo;
static GtkWidget *lightselect_combo;
static GtkWidget *spin_intensity;
static GtkWidget *isolate_button;
static gchar *lighting_effects_path = NULL;
static gchar *lighting_effects_path = NULL;
static void create_main_notebook (GtkWidget *container);
@ -949,6 +949,7 @@ main_dialog (GimpDrawable *drawable)
GtkWidget *frame;
GtkWidget *button;
GtkWidget *toggle;
gchar *path;
gboolean run = FALSE;
/*
@ -956,7 +957,13 @@ main_dialog (GimpDrawable *drawable)
*/
gimp_ui_init ("Lighting", FALSE);
lighting_effects_path = gimp_gimprc_query ("lighting-effects-path");
path = gimp_gimprc_query ("lighting-effects-path");
if (path)
{
lighting_effects_path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL);
g_free (path);
}
lighting_stock_init ();

View File

@ -213,6 +213,7 @@ gfig_dialog (void)
GtkWidget *hbox;
GtkUIManager *ui_manager;
GtkWidget *empty_label;
gchar *path;
gimp_ui_init ("gfig", TRUE);
@ -256,19 +257,23 @@ gfig_dialog (void)
gfig_stock_init ();
gfig_path = gimp_gimprc_query ("gfig-path");
path = gimp_gimprc_query ("gfig-path");
if (! gfig_path)
if (path)
{
gfig_path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL);
g_free (path);
}
else
{
gchar *gimprc = gimp_personal_rc_file ("gimprc");
gchar *full_path;
gchar *esc_path;
full_path =
g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, "gfig",
G_SEARCHPATH_SEPARATOR_S,
"${gimp_data_dir}", G_DIR_SEPARATOR_S, "gfig",
NULL);
full_path = g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, "gfig",
G_SEARCHPATH_SEPARATOR_S,
"${gimp_data_dir}", G_DIR_SEPARATOR_S, "gfig",
NULL);
esc_path = g_strescape (full_path, NULL);
g_free (full_path);

View File

@ -833,9 +833,10 @@ plugin_run (const gchar *name,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
static GimpParam values[1];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gchar *path;
/* Initialize */
run_mode = param[0].data.d_int32;
@ -871,18 +872,22 @@ plugin_run (const gchar *name,
* Parse gflare path from gimprc and load gflares
*/
gflare_path = gimp_gimprc_query ("gflare-path");
if (! gflare_path)
path = gimp_gimprc_query ("gflare-path");
if (path)
{
gflare_path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL);
g_free (path);
}
else
{
gchar *gimprc = gimp_personal_rc_file ("gimprc");
gchar *full_path;
gchar *esc_path;
full_path =
g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, "gflare",
G_SEARCHPATH_SEPARATOR_S,
"${gimp_data_dir}", G_DIR_SEPARATOR_S, "gflare",
NULL);
full_path = g_strconcat ("${gimp_dir}", G_DIR_SEPARATOR_S, "gflare",
G_SEARCHPATH_SEPARATOR_S,
"${gimp_data_dir}", G_DIR_SEPARATOR_S, "gflare",
NULL);
esc_path = g_strescape (full_path, NULL);
g_free (full_path);

View File

@ -102,8 +102,7 @@ static GList *parsepath_cached_path = NULL;
GList *
parsepath (void)
{
gchar *gimpdatasubdir, *defaultpath, *tmps;
gchar *gimpdatasubdir, *defaultpath, *rc_path, *path;
if (parsepath_cached_path)
return parsepath_cached_path;
@ -114,9 +113,13 @@ parsepath (void)
defaultpath = g_build_filename (gimp_directory (),
"gimpressionist", gimpdatasubdir, NULL);
tmps = gimp_gimprc_query ("gimpressionist-path");
if (!tmps)
path = gimp_gimprc_query ("gimpressionist-path");
if (path)
{
rc_path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL);
g_free (path);
}
else
{
if (!g_file_test (gimpdatasubdir, G_FILE_TEST_IS_DIR))
{
@ -137,12 +140,13 @@ parsepath (void)
"(or similar) to your gimprc file."), path);
g_free (path);
}
tmps = g_strdup (defaultpath);
rc_path = g_strdup (defaultpath);
}
parsepath_cached_path = gimp_path_parse (tmps, 16, FALSE, NULL);
parsepath_cached_path = gimp_path_parse (rc_path, 16, FALSE, NULL);
g_free (tmps);
g_free (rc_path);
return parsepath_cached_path;
}