/** 
 * gnome_vfs_drive_unmount:
 * @drive: the #GnomeVFSDrive that should be unmounted.
 * @callback: the #GnomeVFSVolumeOpCallback that should be invoked after unmounting @drive.
 * @user_data: the user data to pass to @callback.
 *
 * gnome_vfs_drive_unmount() invokes gnome_vfs_drive_eject(), if the @drive signals
 * that it should be ejected when it is unmounted. This may be true for CD-ROMs,
 * USB sticks and other devices, depending on the backend providing the #GnomeVFSDrive @drive.
 *
 * If the @drive does not signal that it should be ejected when it is unmounted,
 * gnome_vfs_drive_unmount() calls gnome_vfs_volume_unmount() for each of the
 * @drive's mounted #GnomeVFSVolumes, which can be queried using
 * gnome_vfs_drive_get_mounted_volumes().
 *
 * Since: 2.6
 */
void
gnome_vfs_drive_unmount (GnomeVFSDrive  *drive,
			 GnomeVFSVolumeOpCallback  callback,
			 gpointer                   user_data)
{
	GList *vol_list;
	GList *current_vol;

	if (drive->priv->must_eject_at_unmount) {
		gnome_vfs_drive_eject (drive, callback, user_data);
		return;
	}

	vol_list = gnome_vfs_drive_get_mounted_volumes (drive);

	for (current_vol = vol_list; current_vol != NULL; current_vol = current_vol->next) {
		GnomeVFSVolume *vol;
		vol = GNOME_VFS_VOLUME (current_vol->data);

		gnome_vfs_volume_unmount (vol,
					  callback,
					  user_data);
	}

	gnome_vfs_drive_volume_list_free (vol_list);
}
Example #2
0
void backend_eject(Menu_list_item * menu_item)
{
  gnome_vfs_drive_eject(menu_item->drive, _eject_result, g_strdup(menu_item->comment));
}