GNOME Bugzilla – Bug 383698
Finished download should not open target directory if that directory is Desktop
Last modified: 2007-05-30 11:23:35 UTC
If you download files to your Desktop, there is no need to open Desktop again in a nautilus window. I can see the files right on desktop ;-) Other information: This bug has been opened after a suggestion in bug #138876, comment #38
See bug #138876, relevant stuff is in src/popup-commands.c in save_property_url_completed_cb. Should check if homedir is Desktop and compare the dest with the desktop path. Don't know where to get that info.
"homedir == Desktop" can be found in GConf, g_get_home_dir() + "/Desktop" can be used for the path checking (or is it configurable as well?)
if ( (homedir_is_desktop && dest == homedir) || (homedir+Desktop == dest) ) wiii;
Created attachment 79097 [details] [review] Don't open nautilus windows for downloads that fall into the desktop Anyone got http://www.xenomai.org/index.php/Teaching_-p_to_svn_diff working? Couldn't make a -p diff :(.
+ desktop_is_home_dir = eel_gconf_get_boolean (CONF_OTHERS_DESKTOP_IS_HOME_DIR); + + /* Which is the desktop */ + if (desktop_is_home_dir) + desktop = g_get_home_dir(); + else + desktop = g_build_path ("/", g_get_home_dir(), "Desktop", NULL); + You should use ephy_file_desktop_dir() here.
Created attachment 79113 [details] [review] Updated :)
+ const char *dest, *desktop, *dest_parent; [...] + desktop = ephy_file_desktop_dir (); ephy_file_desktop_dir returns a new string which needs to be freed after use. + /* Where are we going to save */ + uri = gnome_vfs_uri_new (dest); Check for NULL uri here (at least with g_return_if_fail). + parent = gnome_vfs_uri_get_parent (uri); + dest_parent = gnome_vfs_uri_get_path (parent); Can either of these calls return NULL? (e.g. if the URI is already "/" does get_parent return NULL?). Maybe this should use gnome_vfs_uri_equal () of parent with a URI constructed from desktop_dir?
Created attachment 79799 [details] [review] GnomeVFS magic. :)
Looks good, thanks!
Trunk and 2-16? (btw how do I decide that?)
OK, committed to trunk! 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.
Download still opens nautilus windows for Desktop. Version 2.17.92. Tested on Ubuntu Feisty, package version 2.17.92-0ubuntu1, no Ubuntu patches seem to affect this behaviour.
Same version here, but works fine here. Maybe you updated Epiphany but there's an old version still running?
Nope, that's not the problem. But I've found some nuances: - if I download something (e.g. JAR file) using 'Download link' from context menu (right-mouse-button), no nautilus window for Desktop is opened - If I just click on it, then select 'Download' from the dialog ('Save as' | 'Cancel' | 'Download'), it downloads and OPENS nautilus window for Desktop
Can you provide some links Jan?. I seem unable to find a server that makes Ephy offer Download and Save as (at least a download of a small file). As far as I remember, I have been pressing Download all the time and no nautilus windows has appeared.
The jar file I previously tried was on company's intranet but I can get the same behaviour with any jar file. Search Google for: jar filetype:jar The first was Azureus jar from sf.net, I clicked on it, dialog poped up, clicked Download and when it finished, nautilus windows for Desktop has opened. Can't this be caused by some old settings in GConf etc. ?
Hm, yes true. Why is Download button different?
Comment on attachment 79799 [details] [review] GnomeVFS magic. Was this patch committed? If so, please set the patch status.
It was.
I have noticed a sub-optimal behaviour that would seem related to this. On Ubuntu Feisty, if I download something, when it finishes it opens my "downloads" folder, even if the "downloads" folder is already open, for instance from a previous download. So I have two of the same folder open which isn't very elegant. I haven't found it reported on b.g.o or launchpad, but I think it fits as a general case of this bug.
Nautilus browser mode I guess? (everything in the same window)
Any progress of getting to know why "Download" button in dialog opens Desktop and direct "Download link" from context button doesn't?
Created attachment 86737 [details] [review] This fixes the problem by moving the is-desktop check to ephy_file_browse_to I think I didn't forget anything...
Looks good, thanks! Let's commit this to trunk first, and if there aren't any problems reported, later to 2-18.
Committed to trunk.
Please commit to gnome-2-18 :)
Diego, is this one done?
I obviously forgot to commit to 2-18 :D. Sorry! Committed!.
*** Bug 418389 has been marked as a duplicate of this bug. ***