Comment 18 for bug 316959

Revision history for this message
Timothy Arceri (t-fridey) wrote : Re: Music folder appears twice in Rhythmbox

Chris, that may be so but we should still attempt to fix the bug in GTK so that it doesn't happen again in future and so it fixes any issues with other applications i.e Totem.

From what I can make out in the code here is the problem:

gtk_file_chooser_add_shortcut_folder is implemented in http://git.gnome.org/browse/gtk+/tree/gtk/gtkfilechooserdefault.c as

gtk_file_chooser_default_add_shortcut_folder (GtkFileChooser *chooser, GFile *file, GError **error)

Priority is given to any shortcuts added by the application over any bookmarks added at construction time (see line: 8002 if (pos >= 0 && pos < shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR)) )

This shows that any existing bookmarks are ignored and the shortcut is added anyway. The problem appears to be that the duplicate bookmark is not then removed. Note that if you drag and drop one of the other bookmarks than the duplicate correctly disappears. So there seems to be code on the bookmarks side that checks for duplicates, the problem is they have already been created before the shortcut is added.

I tried splitting up the above if statement and adding an else to the second condition where I attempt to remove the bookmark based on the pos but I'm having real trouble building GTK on my machine which I'm not sure I can resolve.