aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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);
}
}
}