[nautilus] nautilus-view-dnd: fix unwanted refresh when dnd over archiver file



commit 393b45ed73440897acd7680d8dbce76fe00cc091
Author: Nelson Benítez León <nbenitezl+gnome gmail com>
Date:   Sun Jan 11 22:17:53 2015 +0500

    nautilus-view-dnd: fix unwanted refresh when dnd over archiver file
    
    When switching slot location while dnd, make sure the target location
    is a directory.
    
    Fixes bug 742766

 src/nautilus-view-dnd.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-view-dnd.c b/src/nautilus-view-dnd.c
index 2a55240..d9fe0fe 100644
--- a/src/nautilus-view-dnd.c
+++ b/src/nautilus-view-dnd.c
@@ -529,13 +529,18 @@ nautilus_view_handle_hover (NautilusView *view,
        NautilusWindowSlot *slot;
        GFile *location;
        GFile *current_location;
+       NautilusFile *target_file;
+       gboolean target_is_dir;
 
        slot = nautilus_view_get_nautilus_window_slot (view);
 
        location = g_file_new_for_uri (target_uri);
+       target_file = nautilus_file_get_existing (location);
+       target_is_dir = nautilus_file_get_file_type (target_file) == G_FILE_TYPE_DIRECTORY;
        current_location = nautilus_window_slot_get_location (slot);
-       if (! (current_location != NULL && g_file_equal(location, current_location))) {
+       if (target_is_dir && ! (current_location != NULL && g_file_equal(location, current_location))) {
                nautilus_window_slot_open_location (slot, location, 0);
        }
        g_object_unref (location);
+       nautilus_file_unref (target_file);
 }


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