diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-01-07 00:45:29 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-01-08 18:48:22 -0500 |
commit | b59c70aaeb060709b5f36b8a228b47006de079c3 (patch) | |
tree | 474662bc5ac78cce0a78298ffd77e8fee0449460 /gtk/gtkfilechooserbutton.c | |
parent | 6fcae42dde049b73c2b5eaed3aabc5cd4ffd2b2a (diff) | |
download | gtk+-b59c70aaeb060709b5f36b8a228b47006de079c3.tar.gz |
filechooserbutton: Use GDK content formats api
Diffstat (limited to 'gtk/gtkfilechooserbutton.c')
-rw-r--r-- | gtk/gtkfilechooserbutton.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index f20423198e..0ecb93a2b0 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -443,6 +443,7 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button) GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button); GtkWidget *box; GtkWidget *icon; + GdkContentFormatsBuilder *builder; GdkContentFormats *target_list; GtkDropTarget *dest; @@ -496,9 +497,10 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button) NULL, NULL); /* DnD */ - target_list = gdk_content_formats_new (NULL, 0); - target_list = gtk_content_formats_add_uri_targets (target_list); - target_list = gtk_content_formats_add_text_targets (target_list); + builder = gdk_content_formats_builder_new (); + gdk_content_formats_builder_add_gtype (builder, G_TYPE_STRING); + gdk_content_formats_builder_add_gtype (builder, GDK_TYPE_FILE_LIST); + target_list = gdk_content_formats_builder_free_to_formats (builder); dest = gtk_drop_target_new (target_list, GDK_ACTION_COPY); g_signal_connect (dest, "drag-drop", G_CALLBACK (gtk_file_chooser_button_drag_drop), button); gtk_widget_add_controller (GTK_WIDGET (button), GTK_EVENT_CONTROLLER (dest)); |