[gvfs/gnome-3-28] smb: Do not claim that mountable can be unmounted



commit 9299ed2620bbbe4b79c0835b25bc43b442d99942
Author: Ondrej Holy <oholy redhat com>
Date:   Tue Jul 24 14:57:14 2018 +0200

    smb: Do not claim that mountable can be unmounted
    
    G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT is set to TRUE, but unmount_mountable()
    is not implemented. Set the attribute always to FALSE in order to prevent
    errors from g_file_unmount_mountable_with_operation().
    
    Nautilus should seamleassly use g_mount_unmount_with_operation() if the
    attribute is set to FALSE.
    
    Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/15

 daemon/gvfsbackendsmbbrowse.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 2ed6fd72..f08d2988 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -1277,15 +1277,10 @@ get_file_info_from_entry (GVfsBackendSmbBrowse *backend, BrowseEntry *entry, GFi
     {
       g_file_info_set_file_type (info, G_FILE_TYPE_MOUNTABLE);
       if (g_mount_tracker_has_mount_spec (mount_tracker, mount_spec))
-       {
-         g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT, FALSE);
-         g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT, TRUE);
-       }
+        g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT, FALSE);
       else
-       {
-         g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT, TRUE);
-         g_file_info_set_attribute_boolean(info, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT, FALSE);
-       }
+        g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT, TRUE);
+      g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT, FALSE);
       g_mount_spec_unref (mount_spec);
     }
   else


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