Index: thunar-vfs/thunar-vfs-volume-hal.c =================================================================== --- thunar-vfs/thunar-vfs-volume-hal.c (revision 25675) +++ thunar-vfs/thunar-vfs-volume-hal.c (working copy) @@ -536,6 +536,10 @@ thunar_vfs_volume_hal_update (ThunarVfsV * a drive, which means non-pollable then, so it's present */ volume_hal->status |= THUNAR_VFS_VOLUME_STATUS_PRESENT; + + /* figure out if the volume is mountable */ + if(hv != NULL && libhal_volume_get_fsusage (hv) == LIBHAL_VOLUME_USAGE_MOUNTABLE_FILESYSTEM) + volume_hal->status |= THUNAR_VFS_VOLUME_STATUS_MOUNTABLE; /* check if the drive requires eject */ volume_hal->requires_eject = libhal_drive_requires_eject (hd); @@ -999,11 +1003,15 @@ thunar_vfs_volume_manager_hal_device_add _thunar_vfs_return_if_fail (THUNAR_VFS_IS_VOLUME_MANAGER_HAL (manager_hal)); _thunar_vfs_return_if_fail (manager_hal->context == context); + /* check if we have a volume here */ + hv = libhal_volume_from_udi (context, udi); + /* HAL might want us to ignore this volume for some reason */ + if (G_LIKELY (hv != NULL) && libhal_volume_should_ignore (hv)) + return; + /* emit the "device-added" signal (to support thunar-volman) */ g_signal_emit_by_name (G_OBJECT (manager_hal), "device-added", udi); - /* check if we have a volume here */ - hv = libhal_volume_from_udi (context, udi); if (G_LIKELY (hv != NULL)) { /* determine the UDI of the drive to which this volume belongs */ Index: thunar-vfs/thunar-vfs-volume-freebsd.c =================================================================== --- thunar-vfs/thunar-vfs-volume-freebsd.c (revision 25675) +++ thunar-vfs/thunar-vfs-volume-freebsd.c (working copy) @@ -317,6 +317,9 @@ thunar_vfs_volume_freebsd_update (gpoint g_strchomp (label); if (G_LIKELY (*label != '\0')) volume_freebsd->label = g_strdup (label); + + /* if we got this far, the CD should be mountable */ + status |= THUNAR_VFS_VOLUME_STATUS_MOUNTABLE; } } } @@ -324,6 +327,11 @@ thunar_vfs_volume_freebsd_update (gpoint close (fd); } } + else + { + /* FIXME: not sure how to determine mountability */ + status |= THUNAR_VFS_VOLUME_STATUS_MOUNTABLE; + } /* determine the absolute path to the mount point */ if (thunar_vfs_path_to_string (volume_freebsd->mount_point, buffer, sizeof (buffer), NULL) > 0) Index: thunar-vfs/thunar-vfs-volume.c =================================================================== --- thunar-vfs/thunar-vfs-volume.c (revision 25675) +++ thunar-vfs/thunar-vfs-volume.c (working copy) @@ -245,6 +245,24 @@ thunar_vfs_volume_is_disc (ThunarVfsVolu /** + * thunar_vfs_volume_is_mountable: + * @volume : a #ThunarVfsVolume instance. + * + * Determines whether @volume has a valid filesystem and + * if it can be mounted. + * + * Return value: %TRUE if @volume is mountable, else %FALSE. + **/ +gboolean +thunar_vfs_volume_is_mountable (ThunarVfsVolume *volume) +{ + g_return_val_if_fail (THUNAR_VFS_IS_VOLUME (volume), FALSE); + return (*THUNAR_VFS_VOLUME_GET_CLASS (volume)->get_status) (volume) & THUNAR_VFS_VOLUME_STATUS_MOUNTABLE; +} + + + +/** * thunar_vfs_volume_is_mounted: * @volume : a #ThunarVfsVolume instance. * Index: thunar-vfs/thunar-vfs-volume.h =================================================================== --- thunar-vfs/thunar-vfs-volume.h (revision 25675) +++ thunar-vfs/thunar-vfs-volume.h (working copy) @@ -82,15 +82,17 @@ typedef enum /** * ThunarVfsVolumeStatus: - * @THUNAR_VFS_VOLUME_STATUS_PRESENT : Whether or not a medium is present. - * @THUNAR_VFS_VOLUME_STATUS_MOUNTED : Whether or not the media is currently mounted. + * @THUNAR_VFS_VOLUME_STATUS_PRESENT : Whether or not a medium is present. + * @THUNAR_VFS_VOLUME_STATUS_MOUNTED : Whether or not the media is currently mounted. + * @THUNAR_VFS_VOLUME_STATUS_MOUNTABLE : Whether or not the media can be mounted. * * Describes the current status of a VFS volume. **/ typedef enum /*< flags >*/ { - THUNAR_VFS_VOLUME_STATUS_MOUNTED = 1 << 0, - THUNAR_VFS_VOLUME_STATUS_PRESENT = 1 << 1, + THUNAR_VFS_VOLUME_STATUS_MOUNTED = 1 << 0, + THUNAR_VFS_VOLUME_STATUS_PRESENT = 1 << 1, + THUNAR_VFS_VOLUME_STATUS_MOUNTABLE = 1 << 2, } ThunarVfsVolumeStatus; GType thunar_vfs_volume_get_type (void) G_GNUC_CONST; @@ -101,6 +103,7 @@ ThunarVfsVolumeStatus thunar_vfs_volume_ ThunarVfsPath *thunar_vfs_volume_get_mount_point (ThunarVfsVolume *volume); gboolean thunar_vfs_volume_is_disc (ThunarVfsVolume *volume); +gboolean thunar_vfs_volume_is_mountable (ThunarVfsVolume *volume); gboolean thunar_vfs_volume_is_mounted (ThunarVfsVolume *volume); gboolean thunar_vfs_volume_is_present (ThunarVfsVolume *volume); gboolean thunar_vfs_volume_is_ejectable (ThunarVfsVolume *volume);