[nautilus] fix misuse of nautilus_file_is_desktop_directory



commit 2d99bcf4bdfb9a56e74298a8b806515529cc5082
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Wed Apr 12 22:39:14 2017 +0300

    fix misuse of nautilus_file_is_desktop_directory
    
    The issue is that when navigating into the Desktop directory, the slot
    is replaced with a desktop window slot.
    
    This happens because when checking if the current location is handled by
    the current slot, the check was made for the actual Desktop directory
    instead for the virtual Desktop.
    
    To fix this, instead of checking if the location matches the actual dir,
    check if it matches the right uri. A similar issue was in files-view
    when creating a new folder, so also change that accordingly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771710

 src/nautilus-files-view.c  |    2 +-
 src/nautilus-window-slot.c |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 38f9d5c..b73ebbc 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2015,7 +2015,7 @@ new_folder_dialog_controller_on_name_accepted (NautilusFileNameWidgetController
 
     parent_uri = nautilus_files_view_get_backing_uri (view);
     parent = nautilus_file_get_by_uri (parent_uri);
-    if (nautilus_file_is_desktop_directory (parent))
+    if (eel_uri_is_desktop (parent_uri))
     {
         position = context_menu_to_file_operation_position (view);
     }
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index b2035f2..39d6229 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -45,6 +45,7 @@
 #include "nautilus-profile.h"
 #include <libnautilus-extension/nautilus-location-widget-provider.h>
 #include "nautilus-ui-utilities.h"
+#include <eel/eel-vfs-extensions.h>
 
 enum
 {
@@ -214,10 +215,13 @@ real_handles_location (NautilusWindowSlot *self,
 {
     NautilusFile *file;
     gboolean handles_location;
+    g_autofree char *uri = NULL;
+
+    uri = g_file_get_uri(location);
 
     file = nautilus_file_get (location);
     handles_location = !nautilus_file_is_other_locations (file) &&
-                       !nautilus_file_is_desktop_directory (file);
+                       !eel_uri_is_desktop (uri);
     nautilus_file_unref (file);
 
     return handles_location;


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