[gnome-disk-utility] Only show eject button if drive has removable media



commit 817d35e330cc5643f186f7211650d1da65ef4c2c
Author: David Zeuthen <zeuthen gmail com>
Date:   Tue Jan 8 10:22:00 2013 -0500

    Only show eject button if drive has removable media
    
    Otherwise we end up showing both power-off and eject buttons for USB
    stick because these, confusingly, are ejectable and don't have
    removable media [1].
    
    [1] : Due to quirks in e.g. /lib/udev/rules.d/80-udisks2.rules setting
    ID_DRIVE_THUMB to 1, e.g.
    
     SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="HP", ENV{ID_MODEL}=="*v125w*", ENV{ID_DRIVE_THUMB}="1"
    
    Signed-off-by: David Zeuthen <zeuthen gmail com>

 src/disks/gduwindow.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index c323beb..867e127 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -2949,7 +2949,7 @@ update_device_page_for_drive (GduWindow      *window,
                   SET_MARKUP_FLAGS_HYPHEN_IF_EMPTY);
     }
 
-  if (udisks_drive_get_ejectable (drive))
+  if (udisks_drive_get_ejectable (drive) && udisks_drive_get_media_removable (drive))
     {
       show_flags->drive_buttons |= SHOW_FLAGS_DRIVE_BUTTONS_EJECT;
     }
@@ -3396,7 +3396,7 @@ update_device_page_for_block (GduWindow          *window,
     }
   else
     {
-      if (drive != NULL && udisks_drive_get_ejectable (drive))
+      if (drive != NULL && udisks_drive_get_ejectable (drive) && udisks_drive_get_media_removable (drive))
         show_flags->drive_buttons |= SHOW_FLAGS_DRIVE_BUTTONS_EJECT;
     }
 



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