aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@svn.gnome.org>2007-01-18 08:16:00 +0800
committerDiego Escalante Urrelo <diegoe@src.gnome.org>2007-01-18 08:16:00 +0800
commit353df69beec07dc0ff87cafef6586f5c6106c964 (patch)
treecea4f6667dfcfd4443dd596cdf1c01d70cba5cd5 /src
parentc7a313999e85639c7eccc2b1e20624e02676c4df (diff)
downloadgsoc2013-epiphany-353df69beec07dc0ff87cafef6586f5c6106c964.tar
gsoc2013-epiphany-353df69beec07dc0ff87cafef6586f5c6106c964.tar.gz
gsoc2013-epiphany-353df69beec07dc0ff87cafef6586f5c6106c964.tar.bz2
gsoc2013-epiphany-353df69beec07dc0ff87cafef6586f5c6106c964.tar.lz
gsoc2013-epiphany-353df69beec07dc0ff87cafef6586f5c6106c964.tar.xz
gsoc2013-epiphany-353df69beec07dc0ff87cafef6586f5c6106c964.tar.zst
gsoc2013-epiphany-353df69beec07dc0ff87cafef6586f5c6106c964.zip
Avoid opening a nautilus window when downloads are finished if the
2007-01-17 Diego Escalante Urrelo <diegoe@svn.gnome.org> * src/popup-commands.c: Avoid opening a nautilus window when downloads are finished if the downloaded file was saved to the desktop. Considers the desktop_is_homedir option of Nautilus. Bug #383698. svn path=/trunk/; revision=6829
Diffstat (limited to 'src')
-rw-r--r--src/popup-commands.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/popup-commands.c b/src/popup-commands.c
index 64e0d0654..ea18060ad 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -175,14 +175,32 @@ save_property_url_completed_cb (EphyEmbedPersist *persist)
EPHY_EMBED_PERSIST_ASK_DESTINATION))
{
const char *dest;
+ char *desktop_dir;
guint32 user_time;
+ GnomeVFSURI *parent, *uri, *desktop;
user_time = ephy_embed_persist_get_user_time (persist);
dest = ephy_embed_persist_get_dest (persist);
g_return_if_fail (dest != NULL);
- eel_gconf_get_string (CONF_STATE_DOWNLOAD_DIR);
- ephy_file_browse_to (dest, user_time);
+ desktop_dir = ephy_file_desktop_dir ();
+
+ /* Where are we going to save */
+ uri = gnome_vfs_uri_new (dest);
+ desktop = gnome_vfs_uri_new (desktop_dir);
+
+ g_return_if_fail (uri != NULL);
+
+ parent = gnome_vfs_uri_get_parent (uri);
+
+ /* If save location is the desktop, don't open it */
+ if (!gnome_vfs_uri_equal (desktop, parent))
+ ephy_file_browse_to (dest, user_time);
+
+ g_free (desktop_dir);
+ gnome_vfs_uri_unref (uri);
+ gnome_vfs_uri_unref (parent);
+ gnome_vfs_uri_unref (desktop);
}
}