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 147521 - add_shortcut_folder should not add duplicates
add_shortcut_folder should not add duplicates
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.4.x
Other Linux
: Normal enhancement
: Small API
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-13 20:02 UTC by Tommi Komulainen
Modified: 2005-10-10 14:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
don't add shortcut if it already exists (2.14 KB, patch)
2004-07-15 17:34 UTC, Tommi Komulainen
accepted-commit_now Details | Review

Description Tommi Komulainen 2004-07-13 20:02:42 UTC
When adding folders to the filechooser shortcut list, it is possible to end up
having multiple shortcuts for the same folder.  The builtin one and the one
application adds.  Since there's no way to know the list of builtin shortcuts,
application can't reliably avoid having duplicates.

Even if the list of shortcuts were available for applications, it shouldn't be
their responsibility to figure out the filechooser internals.
Comment 1 Tommi Komulainen 2004-07-15 17:34:47 UTC
Created attachment 29561 [details] [review]
don't add shortcut if it already exists

This patch adds GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS error code that will be
returned when trying to add a shortcut that already exists.
Comment 2 Matthias Clasen 2004-11-10 05:12:00 UTC
Comment on attachment 29561 [details] [review]
don't add shortcut if it already exists

Looks fine to me.
Comment 3 Christian Neumair 2005-01-31 18:20:13 UTC
Ping.
Comment 4 Kjartan Maraas 2005-05-16 22:54:03 UTC
Should this be commited? Has been accepted-commit_now for a long time.
Comment 5 Crispin Flowerday (not receiving bugmail) 2005-10-10 14:21:49 UTC
Matthias, is this still good to be checked in ?
Comment 6 Tommi Komulainen 2005-10-10 14:30:12 UTC
Committed the patch to HEAD.

2005-10-10  Tommi Komulainen  <tommi.komulainen@iki.fi>

        * gtk/gtkfilechooser.h (GtkFileChooserError): Add ALREADY_EXISTS error
        code.
        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_add_shortcut_folder): Return an error code
        when the shortcut already exists in the sidebar.  (#147521)