summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorDavid Zeuthen <zeuthen@gmail.com>2012-12-11 15:42:19 -0500
committerDavid Zeuthen <zeuthen@gmail.com>2012-12-11 15:42:19 -0500
commitcc6d3d293cd90cb6ed11cb972cc1d931b493a80b (patch)
tree3f9dde2c36c877f715f0d0230d7a1a51b0d81a50 /monitor
parentb3f72baca687f81e7618d4b829ade2df2b59d2b8 (diff)
downloadgvfs-cc6d3d293cd90cb6ed11cb972cc1d931b493a80b.tar.gz
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>
Diffstat (limited to 'monitor')
-rw-r--r--monitor/udisks2/gvfsudisks2drive.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/monitor/udisks2/gvfsudisks2drive.c b/monitor/udisks2/gvfsudisks2drive.c
index b02438ed..b239c6da 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))
{