aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/ephy-file-chooser.c29
2 files changed, 27 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f15e3b1d..17fcad2d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2003-10-26 Christian Persch <chpe@cvs.gnome.org>
+ * lib/ephy-file-chooser.c: (current_folder_changed_cb),
+ (ephy_file_chooser_set_persist_key):
+
+ Convert filenames from/to UTF-8 when persisting the directory.
+
+2003-10-26 Christian Persch <chpe@cvs.gnome.org>
+
* src/window-commands.c: (open_response_cb):
Really used the converted string [in UTF-8] instead of
diff --git a/lib/ephy-file-chooser.c b/lib/ephy-file-chooser.c
index 1f2f853d2..819661876 100644
--- a/lib/ephy-file-chooser.c
+++ b/lib/ephy-file-chooser.c
@@ -82,12 +82,16 @@ current_folder_changed_cb (GtkFileChooser *chooser, EphyFileChooser *dialog)
{
if (dialog->priv->persist_key)
{
- char *dir;
+ char *dir, *converted;
dir = gtk_file_chooser_get_current_folder (chooser);
if (dir != NULL)
{
+ converted = g_filename_to_utf8 (dir, -1, NULL, NULL, NULL);
+
eel_gconf_set_string (dialog->priv->persist_key, dir);
+
+ g_free (converted);
g_free (dir);
}
}
@@ -128,21 +132,28 @@ ephy_file_chooser_set_persist_key (EphyFileChooser *dialog, const char *key)
if (key != NULL)
{
- char *uri;
+ char *dir;
- uri = eel_gconf_get_string (key);
+ dir = eel_gconf_get_string (key);
- if (uri != NULL)
+ if (dir != NULL)
{
- char *expanded;
+ char *expanded, *converted;
+
+ converted = g_filename_from_utf8
+ (dir, -1, NULL, NULL, NULL);
- expanded = gnome_vfs_expand_initial_tilde (uri);
+ expanded = gnome_vfs_expand_initial_tilde (converted);
- gtk_file_chooser_set_current_folder
- (GTK_FILE_CHOOSER (dialog), expanded);
+ if (expanded != NULL)
+ {
+ gtk_file_chooser_set_current_folder
+ (GTK_FILE_CHOOSER (dialog), expanded);
+ }
g_free (expanded);
- g_free (uri);
+ g_free (converted);
+ g_free (dir);
}
}
}