[nautilus/wip/csoriano/destktop-split2: 48/54] file: allow overriding of get_drop_target_uri
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/csoriano/destktop-split2: 48/54] file: allow overriding of get_drop_target_uri
- Date: Wed, 30 Mar 2016 14:06:50 +0000 (UTC)
commit f15c1ef8196524d7b5d66ac4594c1ca8e60a55d9
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Mar 30 14:41:42 2016 +0200
file: allow overriding of get_drop_target_uri
So subclasses like desktop icon can make its own handling, instead
of special casing in the parent.
libnautilus-private/nautilus-file.c | 7 +++++++
libnautilus-private/nautilus-file.h | 2 ++
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 81a1644..10db30c 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3850,6 +3850,12 @@ nautilus_file_get_activation_location (NautilusFile *file)
char *
nautilus_file_get_drop_target_uri (NautilusFile *file)
{
+ return NAUTILUS_FILE_CLASS (G_OBJECT_GET_CLASS (file))->get_drop_target_uri (file);
+}
+
+static char *
+real_get_drop_target_uri (NautilusFile *file)
+{
char *uri, *target_uri;
GFile *location;
NautilusDesktopLink *link;
@@ -8013,6 +8019,7 @@ nautilus_file_class_init (NautilusFileClass *class)
class->set_metadata_as_list = real_set_metadata_as_list;
class->can_rename = real_can_rename;
class->rename = real_rename;
+ class->get_drop_target_uri = real_get_drop_target_uri;
signals[CHANGED] =
g_signal_new ("changed",
diff --git a/libnautilus-private/nautilus-file.h b/libnautilus-private/nautilus-file.h
index 2a7eba9..02e449e 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -568,6 +568,8 @@ typedef struct {
const char *new_name,
NautilusFileOperationCallback callback,
gpointer callback_data);
+
+ char* (* get_drop_target_uri) (NautilusFile *file);
} NautilusFileClass;
#endif /* NAUTILUS_FILE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]