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 516092 - use gtk_drag_*_add_*_targets instead of hardcoded target tables
use gtk_drag_*_add_*_targets instead of hardcoded target tables
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 506853
Blocks:
 
 
Reported: 2008-02-12 20:07 UTC by Christian Persch
Modified: 2008-06-19 12:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Use gtk_drag_[dest|source]_add_[text|uri]_targets(), and simplify code. Bug #516092. (17.77 KB, patch)
2008-02-12 20:08 UTC, Christian Persch
committed Details | Review
[PATCH] Use gtk_drag_[dest|source]_add_[text|uri]_targets(), and simplify code. Bug #516092. (5.97 KB, patch)
2008-06-10 12:37 UTC, Christian Persch
accepted-commit_now Details | Review

Description Christian Persch 2008-02-12 20:07:40 UTC
In many places in gtk, we're doing

  const GtkTargetEntry targets[] = {
    { "text/uri-list", 0, 0 }
  };
  gtk_drag_dest_add (widget, ... targets, ...)

which should use gtk_drag_*_add_uri_targets() instead. Same goes for text targets with gtk_drag_*_add_text_targets(), with the added benefit of offering the same set of targets everywhere.
Comment 1 Christian Persch 2008-02-12 20:08:43 UTC
Created attachment 105083 [details] [review]
[PATCH] Use gtk_drag_[dest|source]_add_[text|uri]_targets(), and simplify code. Bug #516092.

 gtk/gtkentry.c                |   33 ++++-----
 gtk/gtkfilechooserdefault.c   |   74 ++++++--------------
 gtk/gtkfilesel.c              |  154 +++++++++++++----------------------------
 gtk/gtklabel.c                |   21 +++---
 gtk/gtkpathbar.c              |    8 +--
 gtk/gtkrecentchooserdefault.c |   29 +++-----
 6 files changed, 105 insertions(+), 214 deletions(-)
Comment 2 Christian Persch 2008-02-12 20:09:10 UTC
The filechooser parts depend on bug 506853.
Comment 3 Matthias Clasen 2008-02-16 02:31:58 UTC
Committed, except for the filechooser part.

2008-02-15  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkentry.c:
        * gtk/gtkfilesel.c:
        * gtk/gtklabel.c:
        * gtk/gtkpathbar.c: Use gtk_drag_*_add_{text,uri}_targets
        instead of hardcoded target tables.  (#516092, Christian Persch)

Comment 4 Christian Persch 2008-06-10 12:37:59 UTC
Created attachment 112465 [details] [review]
[PATCH] Use gtk_drag_[dest|source]_add_[text|uri]_targets(), and simplify code. Bug #516092.

 gtk/gtkfilechooserdefault.c |   78 ++++++++++++++----------------------------
 1 files changed, 26 insertions(+), 52 deletions(-)
Comment 5 Matthias Clasen 2008-06-14 18:50:20 UTC
Looks fine to me.
Comment 6 Christian Persch 2008-06-19 12:52:18 UTC
        * gtk/gtkfilechooserdefault.c: Use gtk_drag_*_add_*_targets instead of
	hardcoded target tables. Bug #516092.