28 lines
1.2 KiB
Diff
28 lines
1.2 KiB
Diff
|
From bef30fdc1cb0986326eac9acd7b5125cd8f4b61c Mon Sep 17 00:00:00 2001
|
||
|
From: Tomas Bzatek <tbzatek@redhat.com>
|
||
|
Date: Fri, 2 Oct 2009 15:21:51 +0200
|
||
|
Subject: [PATCH 2/3] Disallow ejecting empty drives
|
||
|
|
||
|
Similar to previous commit, hide the Eject menu item when drive has no media.
|
||
|
---
|
||
|
monitor/gdu/ggdudrive.c | 3 ++-
|
||
|
1 files changed, 2 insertions(+), 1 deletions(-)
|
||
|
|
||
|
diff --git a/monitor/gdu/ggdudrive.c b/monitor/gdu/ggdudrive.c
|
||
|
index b99ef6e..3509382 100644
|
||
|
--- a/monitor/gdu/ggdudrive.c
|
||
|
+++ b/monitor/gdu/ggdudrive.c
|
||
|
@@ -188,7 +188,8 @@ 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)) ||
|
||
|
+ 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);
|
||
|
}
|
||
|
--
|
||
|
1.6.5.rc2
|
||
|
|