From e7598d083978e2443d171c9afaab811716433bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Tue, 22 Apr 2008 13:15:54 +0000 Subject: [PATCH] Fix wrong usage of gtk_file_chooser_get_filename() in callback of Open File dialogs in the preferences dialog. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2513 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 3 +++ src/prefs.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00ddec12..eb3470c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * src/plugins.c: Fix GLib warning when starting with a new config. + * src/prefs.c: + Fix wrong usage of gtk_file_chooser_get_filename() in callback of + Open File dialogs in the preferences dialog. 2008-04-20 Enrico Tröger diff --git a/src/prefs.c b/src/prefs.c index 64434184..3e135e9f 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -1503,17 +1503,22 @@ on_prefs_tools_button_clicked (GtkButton *button, /* run it */ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { + gchar *utf8_filename; + tmp = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + utf8_filename = utils_get_utf8_from_locale(tmp); + if (g_strv_length(field) > 1) - filename = g_strconcat(tmp, " ", field[1], NULL); + filename = g_strconcat(utf8_filename, " ", field[1], NULL); else { - filename = tmp; - tmp = NULL; + filename = utf8_filename; + utf8_filename = NULL; } gtk_entry_set_text(GTK_ENTRY(item), filename); g_free(filename); g_free(tmp); + g_free(utf8_filename); } g_strfreev(field);