brasero r1752 - in trunk: . libbrasero-media
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1752 - in trunk: . libbrasero-media
- Date: Wed, 14 Jan 2009 19:42:29 +0000 (UTC)
Author: philippr
Date: Wed Jan 14 19:42:29 2009
New Revision: 1752
URL: http://svn.gnome.org/viewvc/brasero?rev=1752&view=rev
Log:
2009-01-14 Philippe Rouquier <bonfire-app wanadoo fr>
Added a new function to test whether a volume can be ejected
* libbrasero-media/brasero-volume.c (brasero_volume_can_eject):
* libbrasero-media/brasero-volume.h:
Modified:
trunk/ChangeLog
trunk/libbrasero-media/brasero-volume.c
trunk/libbrasero-media/brasero-volume.h
Modified: trunk/libbrasero-media/brasero-volume.c
==============================================================================
--- trunk/libbrasero-media/brasero-volume.c (original)
+++ trunk/libbrasero-media/brasero-volume.c Wed Jan 14 19:42:29 2009
@@ -527,7 +527,7 @@
brasero_volume_operation_end (self);
}
-gboolean
+static gboolean
brasero_volume_eject_gvolume (BraseroVolume *self,
gboolean wait,
GVolume *volume,
@@ -656,6 +656,53 @@
return result;
}
+gboolean
+brasero_volume_can_eject (BraseroVolume *self)
+{
+ GDrive *gdrive;
+ GVolume *volume;
+ gboolean result;
+ BraseroDrive *drive;
+ BraseroVolumePrivate *priv;
+
+ BRASERO_MEDIA_LOG ("Ejecting");
+
+ if (!self)
+ return TRUE;
+
+ priv = BRASERO_VOLUME_PRIVATE (self);
+
+ drive = brasero_medium_get_drive (BRASERO_MEDIUM (self));
+ gdrive = brasero_drive_get_gdrive (drive);
+ if (!gdrive) {
+ BRASERO_MEDIA_LOG ("No GDrive");
+ goto last_resort;
+ }
+
+ if (!g_drive_can_eject (gdrive)) {
+ BRASERO_MEDIA_LOG ("GDrive can't eject");
+ goto last_resort;
+ }
+
+ g_object_unref (gdrive);
+ return TRUE;
+
+last_resort:
+
+ if (gdrive)
+ g_object_unref (gdrive);
+
+ /* last resort */
+ volume = brasero_volume_get_gvolume (self);
+ if (!volume)
+ return FALSE;
+
+ result = g_volume_can_eject (volume);
+ g_object_unref (volume);
+
+ return result;
+}
+
void
brasero_volume_cancel_current_operation (BraseroVolume *self)
{
Modified: trunk/libbrasero-media/brasero-volume.h
==============================================================================
--- trunk/libbrasero-media/brasero-volume.h (original)
+++ trunk/libbrasero-media/brasero-volume.h Wed Jan 14 19:42:29 2009
@@ -76,6 +76,9 @@
GError **error);
gboolean
+brasero_volume_can_eject (BraseroVolume *volume);
+
+gboolean
brasero_volume_eject (BraseroVolume *volume,
gboolean wait,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]