GNOME Bugzilla – Bug 102729
Desktop folder removed when media with same name is ejected
Last modified: 2004-12-22 21:47:04 UTC
Nautilus desktop folder with the same name as media got removed when the media is ejected. And media icon remains on the desktop. Steps to reproduce the problem: - Create a folder on the nautilus desktop with the name "cool" - Insert a Zip and format it with the name "cool". Once format is finished, desktop icon for the zip will appear and it will have "cool (2)" as label. - Now do some operation on some other media like mounting a floppy, ejecting a floppy, inserting a cdrom , ejecting a cdrom etc. - Right click on the ZIP icon, and click Eject to eject zip. The ZIP disk gets ejected, and ZIP's icon "cool (2)" remains there on the desktop but folder icon "cool" gets removed from the desktop. The entry for the folder "cool" in /home/guest/.gnome-desktop/ does not get removed. (So if nautilus is killed or some other media is inserted, the icon for the folder comes back on the desktop. But icon for ZIP, "cool (2)" remains on the desktop.) For the user, it appears that the folder got removed. When a folder and a media have same name, ejecting the media should remove the media icon not the folder icon.
Nautilus gives label as "<name> (2)" to the media if it has the same name as some other folder or a media and it updates the NautilusVolume structure for the media with the name "<name> (2)". The problem is caused due to the buggy code in nautilus-volume-monitor.c:verify_current_mount_state() There are two lists of mounts: monitor->details->mounts and current_mounts This function reads the list of mounts i.e current_mounts, every two seconds, frames a new_list (for new media inserted) and an old_list(for the media ejected) from monitor->details->mounts and curent_mounts. And after that it loads additional information for all the current mounts and assigns the current_mounts to monitor->details->mounts. When new name is given to the media, it is stored in monitor->details->mounts. Since it is getting overwritten every time with current_mounts, old information is lost and moitor->details->mounts does not have info about a media with the name "<name> (2)" and when eject is done, it removes the icon with name "<name>". Solution: Do not overwrite the moitor->details->mounts list every time. If there are any old/new mounts, first delete the old_mounts from list moitor->details->mounts and then add new mounts to the moitor->details->mounts. This is also optimised code as we do not load additional information for all the current mounts but load additional information for new_mounts only. I will put up a patch soon which fixes this problem.
not a nautilus-media bug.
Reassigning to the nautilus maints.
Created attachment 13420 [details] [review] Proposed patch
Still relevant?
This is seen on Solaris. I have to check with the latest build and see if the problem exists. This issue could also depend on other removable media manager patches in given to bugzilla. I will get back after testing it again with all those patches.
Reporter, please test with the latest nautilus 2.3.x. Managing mount icons on the desktop has changed in this version.
Ping?
The code has changed and this patch will not apply now. Also, this patch is not a independent patch. This is a removable media related patch for Solaris. This is difficult to test as there are other dependent patches pending in bug#90942. I will build Nautilus HEAD on Solaris and will test it.
New info => Reopening.
I believe this isn't true anymore on HEAD, since the new code works completely differently. I also tested this to verify that.