After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 102729 - Desktop folder removed when media with same name is ejected
Desktop folder removed when media with same name is ejected
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Desktop
unspecified
Other Solaris
: High normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-01-07 09:29 UTC by Narayana Pattipati
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (3.53 KB, patch)
2003-01-08 14:48 UTC, Narayana Pattipati
none Details | Review

Description Narayana Pattipati 2003-01-07 09:29:52 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.
Comment 1 Narayana Pattipati 2003-01-07 09:35:22 UTC
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.
Comment 2 Thomas Vander Stichele 2003-01-07 09:42:06 UTC
not a nautilus-media  bug.
Comment 3 Dave Bordoley [Not Reading Bug Mail] 2003-01-07 14:15:24 UTC
Reassigning to the nautilus maints.
Comment 4 Narayana Pattipati 2003-01-08 14:48:44 UTC
Created attachment 13420 [details] [review]
Proposed patch
Comment 5 Kjartan Maraas 2003-04-22 23:40:09 UTC
Still relevant?
Comment 6 Narayana Pattipati 2003-04-23 13:35:14 UTC
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. 
Comment 7 Marius Andreiana 2003-07-24 13:49:08 UTC
Reporter, please test with the latest nautilus 2.3.x. Managing mount
icons on the desktop has changed in this version.
Comment 8 Kjartan Maraas 2003-10-31 16:47:49 UTC
Ping?
Comment 9 Narayana Pattipati 2003-11-24 13:54:54 UTC
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.
Comment 10 Martin Wehner 2004-01-25 18:04:28 UTC
New info => Reopening.
Comment 11 Alexander Larsson 2004-02-10 14:01:59 UTC
I believe this isn't true anymore on HEAD, since the new code works
completely differently. I also tested this to verify that.