[nautilus/wip/csoriano/destktop-split2: 45/47] desktop-icon-file: move dnd handling to the subclass



commit 10e74cc6183edffd2145812f706b00b1a46f222d
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Mar 30 21:45:03 2016 +0200

    desktop-icon-file: move dnd handling to the subclass
    
    Now that we can use inheritance for dnd handling, use it in the subclass
    instead of special casing on the parent.

 libnautilus-private/nautilus-desktop-icon-file.c |    8 ++++++++
 libnautilus-private/nautilus-file.c              |    4 ----
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libnautilus-private/nautilus-desktop-icon-file.c 
b/libnautilus-private/nautilus-desktop-icon-file.c
index bd1b31d..ad7614c 100644
--- a/libnautilus-private/nautilus-desktop-icon-file.c
+++ b/libnautilus-private/nautilus-desktop-icon-file.c
@@ -447,6 +447,13 @@ real_can_rename (NautilusFile *file)
         return can_rename;
 }
 
+static gboolean
+real_drag_can_accept_files (NautilusFile *drop_target_item)
+{
+        return TRUE;
+}
+
+
 static void
 nautilus_desktop_icon_file_set_metadata (NautilusFile           *file,
                                         const char             *key,
@@ -490,6 +497,7 @@ nautilus_desktop_icon_file_class_init (NautilusDesktopIconFileClass *klass)
         file_class->can_rename = real_can_rename;
         file_class->rename = real_rename;
         file_class->get_drop_target_uri = real_get_drop_target_uri;
+        file_class->drag_can_accept_files = real_drag_can_accept_files;
 
        g_type_class_add_private (object_class, sizeof(NautilusDesktopIconFileDetails));
 }
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 2aaace9..7940e60 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -8156,10 +8156,6 @@ real_drag_can_accept_files (NautilusFile *drop_target_item)
                return res;
        }
 
-       if (NAUTILUS_IS_DESKTOP_ICON_FILE (drop_target_item)) {
-               return TRUE;
-       }
-
        /* Launchers are an acceptable drop target */
        if (nautilus_file_is_launcher (drop_target_item)) {
                return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]