aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-utils.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-09-20 19:17:54 +0800
committerChristian Persch <chpe@src.gnome.org>2003-09-20 19:17:54 +0800
commitb93121c147570503f42ce2d1d619296b26081d59 (patch)
tree3a0d846c2d897d711ee3ae22d6584101d298b095 /embed/ephy-embed-utils.c
parent68616208eeeee369e62c9256fc9aba5dbe139e3e (diff)
downloadgsoc2013-epiphany-b93121c147570503f42ce2d1d619296b26081d59.tar
gsoc2013-epiphany-b93121c147570503f42ce2d1d619296b26081d59.tar.gz
gsoc2013-epiphany-b93121c147570503f42ce2d1d619296b26081d59.tar.bz2
gsoc2013-epiphany-b93121c147570503f42ce2d1d619296b26081d59.tar.lz
gsoc2013-epiphany-b93121c147570503f42ce2d1d619296b26081d59.tar.xz
gsoc2013-epiphany-b93121c147570503f42ce2d1d619296b26081d59.tar.zst
gsoc2013-epiphany-b93121c147570503f42ce2d1d619296b26081d59.zip
Fix directory selection persistence [bug #122780].
2003-09-20 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed-utils.c: (ephy_embed_utils_save): * embed/mozilla/mozilla-embed-single.cpp: * src/window-commands.c: (window_cmd_file_open): Fix directory selection persistence [bug #122780].
Diffstat (limited to 'embed/ephy-embed-utils.c')
-rw-r--r--embed/ephy-embed-utils.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index ecb3dff7c..ff3dcbef5 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -61,7 +61,6 @@ ephy_embed_utils_save (GtkWidget *window,
char *retPath = NULL;
char *fileName = NULL;
char *dirName = NULL;
- char *retDir;
char *target;
const char *source;
gresult ret;
@@ -136,18 +135,27 @@ ephy_embed_utils_save (GtkWidget *window,
if (ask_dest)
{
+ char *ret_dir;
+
/* show the file picker */
ret = ephy_embed_single_show_file_picker
(single, window, title,
dirName, fileName, modeSave, &retPath,
NULL, NULL);
- }
-
- uri = gnome_vfs_uri_new (retPath);
- g_return_if_fail (uri != NULL);
-
- retDir = gnome_vfs_uri_extract_dirname (uri);
+ if (g_file_test (retPath, G_FILE_TEST_IS_DIR))
+ {
+ ret_dir = g_strdup (retPath);
+ }
+ else
+ {
+ ret_dir = g_path_get_dirname (retPath);
+ }
+
+ /* set default save dir */
+ eel_gconf_set_string (default_dir_pref, ret_dir);
+ g_free (ret_dir);
+ }
if (ret == G_OK)
{
@@ -173,12 +181,6 @@ ephy_embed_utils_save (GtkWidget *window,
}
- /* set default save dir */
- eel_gconf_set_string (default_dir_pref,
- retDir);
-
- g_free (retDir);
- gnome_vfs_uri_unref (uri);
g_free (retPath);
g_object_unref (G_OBJECT(persist));