[nautilus/wip/csoriano/destktop-split2: 37/60] 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: 37/60] file: allow overriding of get_drop_target_uri
- Date: Mon, 4 Apr 2016 21:52:11 +0000 (UTC)
commit a88d831097d3a7d723d189369bb09bdbec613d23
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 7ef00f7..4fc0a4d 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3849,6 +3849,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;
@@ -8012,6 +8018,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 790d67b..e7ed6b9 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -567,6 +567,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]