aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-file-chooser.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-10-26 20:54:20 +0800
committerChristian Persch <chpe@src.gnome.org>2003-10-26 20:54:20 +0800
commit39246b052b1c9188cadbbcc2582f9d9430a8f1ae (patch)
tree5e9c9c92168db5db9b308d0bb680d322ffc05137 /lib/ephy-file-chooser.c
parent9606f610928632663ae8bba5691aa614d098936e (diff)
downloadgsoc2013-epiphany-39246b052b1c9188cadbbcc2582f9d9430a8f1ae.tar.gz
gsoc2013-epiphany-39246b052b1c9188cadbbcc2582f9d9430a8f1ae.tar.zst
gsoc2013-epiphany-39246b052b1c9188cadbbcc2582f9d9430a8f1ae.zip
Convert filenames from/to UTF-8 when persisting the directory.
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.
Diffstat (limited to 'lib/ephy-file-chooser.c')
-rw-r--r--lib/ephy-file-chooser.c29
1 files changed, 20 insertions, 9 deletions
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);
}
}
}