GNOME Bugzilla – Bug 516092
use gtk_drag_*_add_*_targets instead of hardcoded target tables
Last modified: 2008-06-19 12:52:18 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.
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(-)
The filechooser parts depend on bug 506853.
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)
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(-)
Looks fine to me.
* gtk/gtkfilechooserdefault.c: Use gtk_drag_*_add_*_targets instead of hardcoded target tables. Bug #516092.