[gtk/gbsneto/filechooser-column-view: 7/22] filesystemmodel: Don't implement GtkTreeDragSource
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gbsneto/filechooser-column-view: 7/22] filesystemmodel: Don't implement GtkTreeDragSource
- Date: Mon, 10 Oct 2022 16:36:52 +0000 (UTC)
commit 0aaae3d00f69c0b0f787df6dfe8e10242ace540a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Oct 8 12:32:48 2022 -0300
filesystemmodel: Don't implement GtkTreeDragSource
gtk/gtkfilesystemmodel.c | 43 -------------------------------------------
1 file changed, 43 deletions(-)
---
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index fbce75c001..5104a58033 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -647,47 +647,6 @@ gtk_file_system_model_iface_init (GtkTreeModelIface *iface)
iface->unref_node = gtk_file_system_model_unref_node;
}
-/*** GtkTreeDragSource ***/
-
-static gboolean
-drag_source_row_draggable (GtkTreeDragSource *drag_source,
- GtkTreePath *path)
-{
- GtkFileSystemModel *model = GTK_FILE_SYSTEM_MODEL (drag_source);
- GtkTreeIter iter;
-
- if (!gtk_file_system_model_get_iter (GTK_TREE_MODEL (model), &iter, path))
- return FALSE;
-
- return ITER_INDEX (&iter) != 0;
-}
-
-static GdkContentProvider *
-drag_source_drag_data_get (GtkTreeDragSource *drag_source,
- GtkTreePath *path)
-{
- GtkFileSystemModel *model = GTK_FILE_SYSTEM_MODEL (drag_source);
- FileModelNode *node;
- GtkTreeIter iter;
-
- if (!gtk_file_system_model_get_iter (GTK_TREE_MODEL (model), &iter, path))
- return NULL;
-
- node = get_node (model, ITER_INDEX (&iter));
- if (node->file == NULL)
- return FALSE;
-
- return gdk_content_provider_new_typed (G_TYPE_FILE, node->file);
-}
-
-static void
-drag_source_iface_init (GtkTreeDragSourceIface *iface)
-{
- iface->row_draggable = drag_source_row_draggable;
- iface->drag_data_get = drag_source_drag_data_get;
- iface->drag_data_delete = NULL;
-}
-
/*** GListModel ***/
struct _GtkFileSystemItem {
@@ -822,8 +781,6 @@ static guint file_system_model_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (GtkFileSystemModel, _gtk_file_system_model, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
gtk_file_system_model_iface_init)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
- drag_source_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
g_list_model_iface_init))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]