[gvfs] udisks2: don't set GDrive.can_stop to TRUE if drive has removable media



commit cc6d3d293cd90cb6ed11cb972cc1d931b493a80b
Author: David Zeuthen <zeuthen gmail com>
Date:   Tue Dec 11 15:42:19 2012 -0500

    udisks2: don't set GDrive.can_stop to TRUE if drive has removable media
    
    If the drive is using removable media, we want the shell and file
    manager to eject the media, not turn the drive off.
    
    Signed-off-by: David Zeuthen <zeuthen gmail com>

 monitor/udisks2/gvfsudisks2drive.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2drive.c b/monitor/udisks2/gvfsudisks2drive.c
index b02438e..b239c6d 100644
--- a/monitor/udisks2/gvfsudisks2drive.c
+++ b/monitor/udisks2/gvfsudisks2drive.c
@@ -251,15 +251,20 @@ update_drive (GVfsUDisks2Drive *drive)
      *  - Users feeling warm and cozy when they see the LED on the
      *    device turn off (win)
      *
-     * Obviously this is unwanted if the device is internal. Therefore,
-     * only do this for drives we appear *during* the login session.
+     * Obviously this is unwanted if
      *
-     * Note that this heuristic has the nice side-effect that
-     * USB-attached hard disks that are plugged in when the computer
-     * starts up will not be powered off when the user clicks the
-     * "eject" icon.
+     *  - the drive is using removable media (e.g. optical discs,
+     *    flash media etc); or
+     *
+     *  - the device is internal
+     *
+     * So for the latter, only do this for drives we appear *during*
+     * the login session.  Note that this heuristic has the nice
+     * side-effect that USB-attached hard disks that are plugged in
+     * when the computer starts up will not be powered off when the
+     * user clicks the "eject" icon.
      */
-    if (!drive->coldplug)
+    if (!drive->is_media_removable && !drive->coldplug)
       {
         if (udisks_drive_get_can_power_off (drive->udisks_drive))
           {



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