diff -ru thunar-0.8.0.orig/thunar-vfs/thunar-vfs-alias.h thunar-0.8.0/thunar-vfs/thunar-vfs-alias.h --- thunar-0.8.0.orig/thunar-vfs/thunar-vfs-alias.h 2007-01-20 21:42:05.000000000 +0100 +++ thunar-0.8.0/thunar-vfs/thunar-vfs-alias.h 2007-08-15 13:39:18.798204366 +0200 @@ -509,6 +509,9 @@ extern __typeof (thunar_vfs_volume_get_kind) IA__thunar_vfs_volume_get_kind __attribute((visibility("hidden"))); #define thunar_vfs_volume_get_kind IA__thunar_vfs_volume_get_kind +extern __typeof (thunar_vfs_volume_get_eject) IA__thunar_vfs_volume_get_eject __attribute((visibility("hidden"))); +#define thunar_vfs_volume_get_eject IA__thunar_vfs_volume_get_eject + extern __typeof (thunar_vfs_volume_get_name) IA__thunar_vfs_volume_get_name __attribute((visibility("hidden"))); #define thunar_vfs_volume_get_name IA__thunar_vfs_volume_get_name diff -ru thunar-0.8.0.orig/thunar-vfs/thunar-vfs-aliasdef.c thunar-0.8.0/thunar-vfs/thunar-vfs-aliasdef.c --- thunar-0.8.0.orig/thunar-vfs/thunar-vfs-aliasdef.c 2007-01-20 21:42:05.000000000 +0100 +++ thunar-0.8.0/thunar-vfs/thunar-vfs-aliasdef.c 2007-08-15 20:37:23.074219187 +0200 @@ -512,6 +512,9 @@ #undef thunar_vfs_volume_get_kind extern __typeof (thunar_vfs_volume_get_kind) thunar_vfs_volume_get_kind __attribute((alias("IA__thunar_vfs_volume_get_kind"), visibility("default"))); +#undef thunar_vfs_volume_get_eject +extern __typeof (thunar_vfs_volume_get_eject) thunar_vfs_volume_get_eject __attribute((alias("IA__thunar_vfs_volume_get_eject"), visibility("default"))); + #undef thunar_vfs_volume_get_name extern __typeof (thunar_vfs_volume_get_name) thunar_vfs_volume_get_name __attribute((alias("IA__thunar_vfs_volume_get_name"), visibility("default"))); diff -ru thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume-hal.c thunar-0.8.0/thunar-vfs/thunar-vfs-volume-hal.c --- thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume-hal.c 2007-01-20 21:39:09.000000000 +0100 +++ thunar-0.8.0/thunar-vfs/thunar-vfs-volume-hal.c 2007-08-15 20:45:14.541816292 +0200 @@ -50,6 +52,7 @@ static void thunar_vfs_volume_hal_class_init (ThunarVfsVolumeHalClass *klass); static void thunar_vfs_volume_hal_finalize (GObject *object); static ThunarVfsVolumeKind thunar_vfs_volume_hal_get_kind (ThunarVfsVolume *volume); +static const gboolean thunar_vfs_volume_hal_get_eject (ThunarVfsVolume *volume); static const gchar *thunar_vfs_volume_hal_get_name (ThunarVfsVolume *volume); static ThunarVfsVolumeStatus thunar_vfs_volume_hal_get_status (ThunarVfsVolume *volume); static ThunarVfsPath *thunar_vfs_volume_hal_get_mount_point (ThunarVfsVolume *volume); @@ -93,6 +96,7 @@ ThunarVfsPath *mount_point; ThunarVfsVolumeKind kind; ThunarVfsVolumeStatus status; + gboolean eject; }; @@ -136,6 +140,7 @@ thunarvfs_volume_class = THUNAR_VFS_VOLUME_CLASS (klass); thunarvfs_volume_class->get_kind = thunar_vfs_volume_hal_get_kind; + thunarvfs_volume_class->get_eject = thunar_vfs_volume_hal_get_eject; thunarvfs_volume_class->get_name = thunar_vfs_volume_hal_get_name; thunarvfs_volume_class->get_status = thunar_vfs_volume_hal_get_status; thunarvfs_volume_class->get_mount_point = thunar_vfs_volume_hal_get_mount_point; @@ -177,6 +182,14 @@ +static const gboolean +thunar_vfs_volume_hal_get_eject (ThunarVfsVolume *volume) +{ + return THUNAR_VFS_VOLUME_HAL (volume)->eject; +} + + + static const gchar* thunar_vfs_volume_hal_get_name (ThunarVfsVolume *volume) { @@ -423,6 +436,9 @@ volume_hal->mount_point = NULL; } + /* an eject menu entry is shown if this returns true */ + volume_hal->eject = libhal_drive_requires_eject (hd); + /* determine the type of the volume */ switch (libhal_drive_get_type (hd)) { diff -ru thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume-private.h thunar-0.8.0/thunar-vfs/thunar-vfs-volume-private.h --- thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume-private.h 2007-01-20 21:39:09.000000000 +0100 +++ thunar-0.8.0/thunar-vfs/thunar-vfs-volume-private.h 2007-08-15 13:39:18.798204366 +0200 @@ -34,6 +34,7 @@ /* methods */ ThunarVfsVolumeKind (*get_kind) (ThunarVfsVolume *volume); + const gboolean (*get_eject) (ThunarVfsVolume *volume); const gchar *(*get_name) (ThunarVfsVolume *volume); ThunarVfsVolumeStatus (*get_status) (ThunarVfsVolume *volume); ThunarVfsPath *(*get_mount_point) (ThunarVfsVolume *volume); diff -ru thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume.c thunar-0.8.0/thunar-vfs/thunar-vfs-volume.c --- thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume.c 2007-01-20 21:39:09.000000000 +0100 +++ thunar-0.8.0/thunar-vfs/thunar-vfs-volume.c 2007-08-15 20:37:23.574184825 +0200 @@ -157,6 +157,14 @@ +const gboolean +thunar_vfs_volume_get_eject (ThunarVfsVolume *volume) +{ + return (*THUNAR_VFS_VOLUME_GET_CLASS (volume)->get_eject) (volume); +} + + + /** * thunar_vfs_volume_get_name; * @volume : a #ThunarVfsVolume instance. @@ -235,11 +243,11 @@ ThunarVfsVolumeKind kind; g_return_val_if_fail (THUNAR_VFS_IS_VOLUME (volume), FALSE); - kind = thunar_vfs_volume_get_kind (volume); return (kind >= THUNAR_VFS_VOLUME_KIND_CDROM && kind <= THUNAR_VFS_VOLUME_KIND_DVDPLUSRW) - || (kind == THUNAR_VFS_VOLUME_KIND_AUDIO_CD); + || (kind == THUNAR_VFS_VOLUME_KIND_AUDIO_CD + || thunar_vfs_volume_get_eject (volume)); } diff -ru thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume.h thunar-0.8.0/thunar-vfs/thunar-vfs-volume.h --- thunar-0.8.0.orig/thunar-vfs/thunar-vfs-volume.h 2007-01-20 21:39:09.000000000 +0100 +++ thunar-0.8.0/thunar-vfs/thunar-vfs-volume.h 2007-08-15 13:39:18.798204366 +0200 @@ -96,6 +96,7 @@ GType thunar_vfs_volume_get_type (void) G_GNUC_CONST; ThunarVfsVolumeKind thunar_vfs_volume_get_kind (ThunarVfsVolume *volume); +const gboolean thunar_vfs_volume_get_eject (ThunarVfsVolume *volume); const gchar *thunar_vfs_volume_get_name (ThunarVfsVolume *volume); ThunarVfsVolumeStatus thunar_vfs_volume_get_status (ThunarVfsVolume *volume); ThunarVfsPath *thunar_vfs_volume_get_mount_point (ThunarVfsVolume *volume); diff -ru thunar-0.8.0.orig/thunar-vfs/thunar-vfs.symbols thunar-0.8.0/thunar-vfs/thunar-vfs.symbols --- thunar-0.8.0.orig/thunar-vfs/thunar-vfs.symbols 2007-01-20 21:39:09.000000000 +0100 +++ thunar-0.8.0/thunar-vfs/thunar-vfs.symbols 2007-08-15 13:39:18.798204366 +0200 @@ -314,6 +314,7 @@ #if IN_SOURCE(__THUNAR_VFS_VOLUME_C__) thunar_vfs_volume_get_type G_GNUC_CONST thunar_vfs_volume_get_kind +thunar_vfs_volume_get_eject thunar_vfs_volume_get_name thunar_vfs_volume_get_status thunar_vfs_volume_get_mount_point