summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystemmodel.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-02-18 01:41:42 +0100
committerBenjamin Otte <otte@redhat.com>2020-02-18 02:40:00 +0100
commitb8cf7ea1c6ee97c3ad1a95717d62bcfe33786116 (patch)
tree109746158e14bbb59256ce98b21963847ca91b87 /gtk/gtkfilesystemmodel.c
parent1145da3ea5a60387ea4bc7a93ee52f08a3c20b80 (diff)
downloadgtk+-b8cf7ea1c6ee97c3ad1a95717d62bcfe33786116.tar.gz
dnd: Port the TreeModel machinery to GValue DND
Diffstat (limited to 'gtk/gtkfilesystemmodel.c')
-rw-r--r--gtk/gtkfilesystemmodel.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index bf49e0196b..8f382b8a3d 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -965,29 +965,22 @@ drag_source_row_draggable (GtkTreeDragSource *drag_source,
return ITER_INDEX (&iter) != 0;
}
-static gboolean
+static GdkContentProvider *
drag_source_drag_data_get (GtkTreeDragSource *drag_source,
- GtkTreePath *path,
- GtkSelectionData *selection_data)
+ GtkTreePath *path)
{
GtkFileSystemModel *model = GTK_FILE_SYSTEM_MODEL (drag_source);
FileModelNode *node;
GtkTreeIter iter;
- char *uris[2];
if (!gtk_file_system_model_get_iter (GTK_TREE_MODEL (model), &iter, path))
- return FALSE;
+ return NULL;
node = get_node (model, ITER_INDEX (&iter));
if (node->file == NULL)
return FALSE;
- uris[0] = g_file_get_uri (node->file);
- uris[1] = NULL;
- gtk_selection_data_set_uris (selection_data, uris);
- g_free (uris[0]);
-
- return TRUE;
+ return gdk_content_provider_new_typed (G_TYPE_FILE, node->file);
}
static void