summaryrefslogtreecommitdiff
path: root/gtk/gtkrecentchooserdefault.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2008-02-16 02:31:33 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-02-16 02:31:33 +0000
commit13277493eb99fc0e5d99acd719ab54a2cd83dadb (patch)
tree8242e7bd9b13d10c754f40cfaaf6e918fa389a2d /gtk/gtkrecentchooserdefault.c
parent3b3122ee066350badef46204cad31325c6da97e1 (diff)
downloadgtk+-13277493eb99fc0e5d99acd719ab54a2cd83dadb.tar.gz
Use gtk_drag_*_add_{text,uri}_targets instead of hardcoded target tables.
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) svn path=/trunk/; revision=19590
Diffstat (limited to 'gtk/gtkrecentchooserdefault.c')
-rw-r--r--gtk/gtkrecentchooserdefault.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/gtk/gtkrecentchooserdefault.c b/gtk/gtkrecentchooserdefault.c
index 2eafcde2ef..7f47d303f1 100644
--- a/gtk/gtkrecentchooserdefault.c
+++ b/gtk/gtkrecentchooserdefault.c
@@ -153,15 +153,6 @@ enum {
LOAD_FINISHED /* the model is fully loaded and inserted */
};
-enum {
- TEXT_URI_LIST
-};
-
-/* Target types for DnD from the file list */
-static const GtkTargetEntry recent_list_source_targets[] = {
- { "text/uri-list", 0, TEXT_URI_LIST }
-};
-
/* Icon size for if we can't get it from the theme */
#define FALLBACK_ICON_SIZE 48
#define FALLBACK_ITEM_LIMIT 20
@@ -451,9 +442,9 @@ gtk_recent_chooser_default_constructor (GType type,
/* drag and drop */
gtk_drag_source_set (impl->recent_view,
GDK_BUTTON1_MASK,
- recent_list_source_targets,
- G_N_ELEMENTS (recent_list_source_targets),
+ NULL, 0,
GDK_ACTION_COPY);
+ gtk_drag_source_add_uri_targets (impl->recent_view);
impl->filter_combo_hbox = gtk_hbox_new (FALSE, 12);
@@ -1535,25 +1526,23 @@ recent_view_drag_data_get_cb (GtkWidget *widget,
gpointer data)
{
GtkRecentChooserDefault *impl = GTK_RECENT_CHOOSER_DEFAULT (data);
- DragData *drag_data;
+ DragData drag_data;
gsize n_uris;
n_uris = gtk_tree_selection_count_selected_rows (impl->selection);
if (n_uris == 0)
- return;
+ return;
- drag_data = g_new (DragData, 1);
- drag_data->uri_list = g_new0 (gchar *, n_uris + 1);
- drag_data->next_pos = 0;
+ drag_data.uri_list = g_new0 (gchar *, n_uris + 1);
+ drag_data.next_pos = 0;
gtk_tree_selection_selected_foreach (impl->selection,
append_uri_to_urilist,
- drag_data);
+ &drag_data);
- gtk_selection_data_set_uris (selection_data, drag_data->uri_list);
+ gtk_selection_data_set_uris (selection_data, drag_data.uri_list);
- g_strfreev (drag_data->uri_list);
- g_free (drag_data);
+ g_strfreev (drag_data.uri_list);
}
static gboolean