[nautilus/wip/csoriano/destktop-split2: 43/47] 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: 43/47] file: allow overriding dnd handling
- Date: Wed, 30 Mar 2016 20:01:41 +0000 (UTC)
commit 92d2d600afa31e23128e8641ea4459e364c68bb7
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 | 8 ++++++++
libnautilus-private/nautilus-file.h | 2 ++
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index da1d312..f8b1d4f 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -166,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,
@@ -8005,6 +8006,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;
signals[CHANGED] =
g_signal_new ("changed",
@@ -8128,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 f786391..9045062 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -600,6 +600,8 @@ typedef struct {
gpointer callback_data);
char* (* get_drop_target_uri) (NautilusFile *file);
+
+ gboolean (* drag_can_accept_files) (NautilusFile *drop_target_item);
} NautilusFileClass;
#endif /* NAUTILUS_FILE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]