summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2009-10-13 17:12:33 +0200
committerTomas Bzatek <tbzatek@redhat.com>2009-10-13 17:14:24 +0200
commit9fcb94f8d86f91f7f1d91d48399bf0c994e6c544 (patch)
treef4db0bee1c284d23d7465d220298dc8fd5f85452 /monitor
parent059c58f93665d72be8ad1ffa0d68f3866b50aaa0 (diff)
downloadgvfs-9fcb94f8d86f91f7f1d91d48399bf0c994e6c544.tar.gz
Disallow ejecting empty drives
Similar to previous commit, hide the Eject menu item when drive has no media.
Diffstat (limited to 'monitor')
-rw-r--r--monitor/gdu/ggdudrive.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/monitor/gdu/ggdudrive.c b/monitor/gdu/ggdudrive.c
index 20f8940b..79c68092 100644
--- a/monitor/gdu/ggdudrive.c
+++ b/monitor/gdu/ggdudrive.c
@@ -188,7 +188,9 @@ update_drive (GGduDrive *drive)
*
* See also below where we e.g. set can_eject to TRUE for non-removable drives.
*/
- drive->can_eject = gdu_device_drive_get_is_media_ejectable (device) || gdu_device_drive_get_requires_eject (device) || gdu_device_is_removable (device);
+ drive->can_eject = ((gdu_device_drive_get_is_media_ejectable (device) || gdu_device_is_removable (device)) &&
+ gdu_device_is_media_available (device) && ! _is_pc_floppy_drive (device)) ||
+ gdu_device_drive_get_requires_eject (device);
drive->is_media_check_automatic = gdu_device_is_media_change_detected (device);
drive->can_poll_for_media = gdu_device_is_removable (device);
}