[nautilus/wip/csoriano/destktop-split2: 54/54] file: allow overriding dnd handling
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/csoriano/destktop-split2: 54/54] file: allow overriding dnd handling
- Date: Wed, 30 Mar 2016 14:07:20 +0000 (UTC)
commit d49398f1a2c8f5359b8d7eb0fc7ff67d5aa898bb
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Mar 30 16:02:49 2016 +0200
file: allow overriding dnd handling
Subclasses may want to override some dnd handling.
libnautilus-private/nautilus-file.c | 9 +++++++++
libnautilus-private/nautilus-file.h | 2 ++
2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 5162a1e..c2d60ff 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -25,6 +25,7 @@
#include "nautilus-directory-notify.h"
#include "nautilus-directory-private.h"
+#include "nautilus-desktop-icon-file.h"
#include "nautilus-signaller.h"
#include "nautilus-file-attributes.h"
#include "nautilus-file-private.h"
@@ -165,6 +166,7 @@ static const char * nautilus_file_peek_display_name (NautilusFile *file);
static const char * nautilus_file_peek_display_name_collation_key (NautilusFile *file);
static void file_mount_unmounted (GMount *mount, gpointer data);
static void metadata_hash_free (GHashTable *hash);
+static gboolean real_drag_can_accept_files (NautilusFile *drop_target_item);
G_DEFINE_TYPE_WITH_CODE (NautilusFile, nautilus_file, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (NAUTILUS_TYPE_FILE_INFO,
@@ -8003,6 +8005,7 @@ nautilus_file_class_init (NautilusFileClass *class)
class->can_rename = real_can_rename;
class->rename = real_rename;
class->get_drop_target_uri = real_get_drop_target_uri;
+ class->drag_can_accept_files = real_drag_can_accept_files;
class->invalidate_attributes_internal = real_invalidate_attributes_internal;
signals[CHANGED] =
@@ -8127,6 +8130,12 @@ nautilus_file_info_providers_done (NautilusFile *file)
static gboolean
nautilus_drag_can_accept_files (NautilusFile *drop_target_item)
{
+ return NAUTILUS_FILE_CLASS (G_OBJECT_GET_CLASS (drop_target_item))->drag_can_accept_files
(drop_target_item);
+}
+
+static gboolean
+real_drag_can_accept_files (NautilusFile *drop_target_item)
+{
if (nautilus_file_is_directory (drop_target_item)) {
NautilusDirectory *directory;
gboolean res;
diff --git a/libnautilus-private/nautilus-file.h b/libnautilus-private/nautilus-file.h
index 8b52e32..e9e73de 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -601,6 +601,8 @@ typedef struct {
char* (* get_drop_target_uri) (NautilusFile *file);
+ gboolean (* drag_can_accept_files) (NautilusFile *drop_target_item);
+
void (* invalidate_attributes_internal) (NautilusFile *file,
NautilusFileAttributes file_attributes);
} NautilusFileClass;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]