Commit c368bba5 authored by Philippe Rouquier's avatar Philippe Rouquier

Lots of fixes. Now checksum plugin (and checksuming in general) works.

svn path=/trunk/; revision=267
parent 9f542295
2007-08-2 Rouquier Philippe <bonfire-app@wanadoo.fr>
In the process of making md5checksum work, lots of bugs and leaks fixed
Now reap the processes ourselves to get return values and make sure nothing goes wrong
Fixed a small bug in medium for blank DVD+RW (bad free space)
Don't set non blocking by default now plugins have to ask for it
Fix build and don't set brasero depend on libisofs/libburn but their plugins only
Fixed and improved burn-dialog.c
Fixed confusion between brasero_job_get_action and brasero_job_get_current_action
Fixed growisofs not burning from pipe
2007-07-28 Rouquier Philippe <bonfire-app@wanadoo.fr>
Better handling of jobs that don't want to run further than ::start.
......
......@@ -116,8 +116,11 @@ else
fi
if test x"$build_libburn" = "xyes"; then
BRASERO_CFLAGS="$BRASERO_CFLAGS $LIBBURN_CFLAGS"
BRASERO_LIBS="$BRASERO_LIBS $LIBBURN_LIBS"
AC_SUBST(BRASERO_LIBBURNIA_CFLAGS)
AC_SUBST(BRASERO_LIBBURNIA_LIBS)
BRASERO_LIBBURNIA_CFLAGS="$LIBBURN_CFLAGS"
BRASERO_LIBBURNIA_LIBS="$LIBBURN_LIBS"
AC_DEFINE(HAVE_LIBBURN, 1, [define if you want to use with libburn support])
fi
AM_CONDITIONAL(HAVE_LIBBURN, test x"$build_libburn" = "xyes")
......
......@@ -86,6 +86,7 @@ brasero_burn_dialog_tray_close_after_cb (BraseroTrayIcon *tray,
struct BraseroBurnDialogPrivate {
BraseroBurn *burn;
BraseroTrackDataType input;
BraseroBurnSession *session;
GtkWidget *close_check;
......@@ -99,7 +100,6 @@ struct BraseroBurnDialogPrivate {
};
#define TIMEOUT 10000
#define WAITED_FOR_DRIVE "WaitedForDriveKey"
static GObjectClass *parent_class = NULL;
......@@ -142,6 +142,125 @@ brasero_burn_dialog_class_init (BraseroBurnDialogClass * klass)
widget_class->delete_event = brasero_burn_dialog_delete;
}
/**
* NOTE: if input is DISC then media is the media input
*/
static void
brasero_burn_dialog_update_info (BraseroBurnDialog *dialog,
BraseroTrackDataType input,
BraseroMedia media)
{
gchar *title = NULL;
gchar *header = NULL;
if (media == BRASERO_MEDIUM_FILE) {
/* we are creating an image to the hard drive */
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"iso-image-new",
GTK_ICON_SIZE_DIALOG);
header = g_strdup_printf ("<big><b>Creating image</b></big>");
title = g_strdup (_("Creating image"));
}
else if (media & BRASERO_MEDIUM_DVD) {
if (input == BRASERO_TRACK_TYPE_DATA) {
title = g_strdup (_("Burning DVD"));
header = g_strdup (_("<big><b>Burning data DVD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-data-new",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_IMAGE) {
title = g_strdup (_("Burning DVD"));
header = g_strdup (_("<big><b>Burning image to DVD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_DISC) {
title = g_strdup (_("Copying DVD"));
header = g_strdup (_("<big><b>Copying data DVD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-copy",
GTK_ICON_SIZE_DIALOG);
}
}
else if (media & BRASERO_MEDIUM_CD) {
if (input == BRASERO_TRACK_TYPE_AUDIO) {
title = g_strdup (_("Burning CD"));
header = g_strdup_printf (_("<big><b>Burning audio CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-audio-new",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_DATA) {
title = g_strdup (_("Burning CD"));
header = g_strdup_printf (_("<big><b>Burning data CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-data-new",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_DISC) {
title = g_strdup (_("Copying CD"));
header = g_strdup(_("<big><b>Copying CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-copy",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_IMAGE) {
title = g_strdup (_("Burning CD"));
header = g_strdup (_("<big><b>Burning image to CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical",
GTK_ICON_SIZE_DIALOG);
}
}
else if (input == BRASERO_TRACK_TYPE_AUDIO) {
title = g_strdup (_("Burning CD"));
header = g_strdup_printf (_("<big><b>Burning audio CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_DATA) {
title = g_strdup (_("Burning disc"));
header = g_strdup_printf (_("<big><b>Burning data disc</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_DISC) {
title = g_strdup (_("Copying disc"));
header = g_strdup(_("<big><b>Copying disc</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
else if (input == BRASERO_TRACK_TYPE_IMAGE) {
title = g_strdup (_("Burning disc"));
header = g_strdup (_("<big><b>Burning image to disc</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
gtk_window_set_title (GTK_WINDOW (dialog), title);
g_free (title);
gtk_label_set_text (GTK_LABEL (dialog->priv->header), header);
gtk_label_set_use_markup (GTK_LABEL (dialog->priv->header), TRUE);
g_free (header);
}
static gchar *
brasero_burn_dialog_get_media_type_string (BraseroBurn *burn,
BraseroMedia type,
......@@ -152,7 +271,7 @@ brasero_burn_dialog_get_media_type_string (BraseroBurn *burn,
if (type & BRASERO_MEDIUM_HAS_DATA) {
if (!insert) {
if (type & BRASERO_MEDIUM_WRITABLE)
message = g_strdup (_("replace the disc with the burnt media to perform an integrity check"));
message = g_strdup (_("replace the disc with the media to check its integrity"));
else if (type & BRASERO_MEDIUM_REWRITABLE)
message = g_strdup (_("replace the disc with a rewritable disc holding data."));
else
......@@ -160,7 +279,7 @@ brasero_burn_dialog_get_media_type_string (BraseroBurn *burn,
}
else {
if (type & BRASERO_MEDIUM_WRITABLE)
message = g_strdup (_("insert the burnt media to perform an integrity check"));
message = g_strdup (_("insert the media to check its integrity"));
else if (type & BRASERO_MEDIUM_REWRITABLE)
message = g_strdup (_("insert a rewritable disc holding data."));
else
......@@ -228,19 +347,9 @@ brasero_burn_dialog_get_media_type_string (BraseroBurn *burn,
}
static void
brasero_burn_dialog_wait_for_insertion (NautilusBurnDriveMonitor *monitor,
NautilusBurnDrive *drive,
brasero_burn_dialog_wait_for_insertion (NautilusBurnDrive *drive,
GtkDialog *message)
{
NautilusBurnDrive *waited_drive;
waited_drive = g_object_get_data (G_OBJECT (message), WAITED_FOR_DRIVE);
/* we must make sure that the change was triggered
* by the current selected drive */
if (!nautilus_burn_drive_equal (drive, waited_drive))
return;
/* we might have a dialog waiting for the
* insertion of a disc if so close it */
gtk_dialog_response (GTK_DIALOG (message), GTK_RESPONSE_OK);
......@@ -259,7 +368,6 @@ brasero_burn_dialog_insert_disc_cb (BraseroBurn *burn,
GtkWindow *window;
GtkWidget *message;
gboolean hide = FALSE;
NautilusBurnDriveMonitor *monitor;
gchar *main_message = NULL, *secondary_message = NULL;
if (!GTK_WIDGET_VISIBLE (dialog)) {
......@@ -267,7 +375,6 @@ brasero_burn_dialog_insert_disc_cb (BraseroBurn *burn,
hide = TRUE;
}
/* FIXME: we should specify the name of the drive where to put the disc */
if (drive)
drive_name = nautilus_burn_drive_get_name_for_display (drive);
else
......@@ -364,19 +471,32 @@ brasero_burn_dialog_insert_disc_cb (BraseroBurn *burn,
gtk_window_set_title (GTK_WINDOW (message), _("Waiting for disc replacement"));
/* connect to signals to be warned when media is inserted */
g_object_set_data (G_OBJECT (message), WAITED_FOR_DRIVE, drive);
monitor = nautilus_burn_get_drive_monitor ();
added_id = g_signal_connect_after (monitor,
added_id = g_signal_connect_after (drive,
"media-added",
G_CALLBACK (brasero_burn_dialog_wait_for_insertion),
message);
result = gtk_dialog_run (GTK_DIALOG (message));
g_signal_handler_disconnect (monitor, added_id);
g_signal_handler_disconnect (drive, added_id);
gtk_widget_destroy (message);
/* see if we should update the infos */
if (dialog->priv->input == BRASERO_TRACK_TYPE_DISC) {
NautilusBurnDrive *src;
/* see if the drive is the source */
src = brasero_burn_session_get_src_drive (dialog->priv->session);
if (nautilus_burn_drive_equal (src, drive))
brasero_burn_dialog_update_info (dialog,
dialog->priv->input,
NCB_MEDIA_GET_STATUS (drive));
}
else
brasero_burn_dialog_update_info (dialog,
dialog->priv->input,
NCB_MEDIA_GET_STATUS (drive));
if (hide)
gtk_widget_hide (GTK_WIDGET (dialog));
......@@ -829,151 +949,6 @@ brasero_burn_dialog_activity_stop (BraseroBurnDialog *dialog,
gtk_window_set_urgency_hint (GTK_WINDOW (dialog), TRUE);
}
static void
brasero_burn_dialog_update_info (BraseroBurnDialog *dialog)
{
gchar *title = NULL;
gchar *header = NULL;
BraseroMedia media;
BraseroTrackType source;
NautilusBurnDrive *drive;
/* check what drive we should display */
brasero_burn_session_get_input_type (dialog->priv->session, &source);
if (!BRASERO_BURN_SESSION_NO_TMP_FILE (dialog->priv->session)
|| source.type != BRASERO_TRACK_TYPE_DISC) {
drive = brasero_burn_session_get_burner (dialog->priv->session);
if (NCB_DRIVE_GET_TYPE (drive) == NAUTILUS_BURN_DRIVE_TYPE_FILE) {
/* we are creating an image to the hard drive */
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"iso-image-new",
GTK_ICON_SIZE_DIALOG);
header = g_strdup_printf ("<big><b>Creating image</b></big>");
title = g_strdup (_("Creating image"));
goto end;
}
}
else
drive = brasero_burn_session_get_src_drive (dialog->priv->session);
media = NCB_MEDIA_GET_STATUS (drive);
if (media & BRASERO_MEDIUM_DVD) {
if (source.type == BRASERO_TRACK_TYPE_DATA) {
title = g_strdup (_("Burning DVD"));
header = g_strdup (_("<big><b>Burning data DVD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-data-new",
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_IMAGE) {
title = g_strdup (_("Burning DVD"));
header = g_strdup (_("<big><b>Burning image to DVD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
NCB_MEDIA_GET_ICON (drive),
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_DISC) {
title = g_strdup (_("Copying DVD"));
header = g_strdup (_("<big><b>Copying data DVD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-copy",
GTK_ICON_SIZE_DIALOG);
}
}
else if (media & BRASERO_MEDIUM_CD) {
if (source.type == BRASERO_TRACK_TYPE_AUDIO) {
title = g_strdup (_("Burning CD"));
header = g_strdup_printf (_("<big><b>Burning audio CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-audio-new",
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_DATA) {
title = g_strdup (_("Burning CD"));
header = g_strdup_printf (_("<big><b>Burning data CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-data-new",
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_DISC) {
title = g_strdup (_("Copying CD"));
header = g_strdup(_("<big><b>Copying CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"media-optical-copy",
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_IMAGE) {
title = g_strdup (_("Burning CD"));
header = g_strdup (_("<big><b>Burning image to CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
NCB_MEDIA_GET_ICON (drive),
GTK_ICON_SIZE_DIALOG);
}
}
else if (source.type == BRASERO_TRACK_TYPE_AUDIO) {
title = g_strdup (_("Burning CD"));
header = g_strdup_printf (_("<big><b>Burning audio CD</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_DATA) {
title = g_strdup (_("Burning disc"));
header = g_strdup_printf (_("<big><b>Burning data disc</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_DISC) {
title = g_strdup (_("Copying disc"));
header = g_strdup(_("<big><b>Copying disc</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
else if (source.type == BRASERO_TRACK_TYPE_IMAGE) {
title = g_strdup (_("Burning disc"));
header = g_strdup (_("<big><b>Burning image to disc</b></big>"));
gtk_image_set_from_icon_name (GTK_IMAGE (dialog->priv->image),
"gnome-dev-removable",
GTK_ICON_SIZE_DIALOG);
}
end:
nautilus_burn_drive_unref (drive);
gtk_window_set_title (GTK_WINDOW (dialog), title);
g_free (title);
gtk_label_set_text (GTK_LABEL (dialog->priv->header), header);
gtk_label_set_use_markup (GTK_LABEL (dialog->priv->header), TRUE);
g_free (header);
}
static void
brasero_burn_dialog_input_changed_cb (BraseroBurnSession *session,
BraseroBurnDialog *dialog)
{
brasero_burn_dialog_update_info (dialog);
}
static void
brasero_burn_dialog_output_changed_cb (BraseroBurnSession *session,
BraseroBurnDialog *dialog)
{
brasero_burn_dialog_update_info (dialog);
}
static BraseroBurnResult
brasero_burn_dialog_setup_session (BraseroBurnDialog *dialog,
GError **error)
......@@ -1455,8 +1430,7 @@ gboolean
brasero_burn_dialog_run (BraseroBurnDialog *dialog,
BraseroBurnSession *session)
{
gint input_sig;
gint output_sig;
BraseroMedia media;
GError *error = NULL;
gboolean close_dialog;
BraseroBurnResult result;
......@@ -1464,20 +1438,24 @@ brasero_burn_dialog_run (BraseroBurnDialog *dialog,
dialog->priv->session = session;
g_object_ref (session);
/* Leave the time to all sub systems and libs to get notified */
brasero_burn_dialog_update_info (dialog);
input_sig = g_signal_connect_after (session,
"input-changed",
G_CALLBACK (brasero_burn_dialog_input_changed_cb),
dialog);
output_sig = g_signal_connect_after (session,
"output-changed",
G_CALLBACK (brasero_burn_dialog_output_changed_cb),
dialog);
/* update what we should display */
dialog->priv->input = brasero_burn_session_get_input_type (session, NULL);
if (brasero_burn_session_is_dest_file (session))
media = BRASERO_MEDIUM_FILE;
else if (dialog->priv->input != BRASERO_TRACK_TYPE_DISC)
media = brasero_burn_session_get_dest_media (session);
else {
NautilusBurnDrive *drive;
brasero_burn_dialog_activity_start (dialog);
drive = brasero_burn_session_get_src_drive (dialog->priv->session);
media = NCB_MEDIA_GET_STATUS (drive);
}
brasero_burn_dialog_update_info (dialog, dialog->priv->input, media);
/* start the recording session */
brasero_burn_dialog_activity_start (dialog);
result = brasero_burn_dialog_setup_session (dialog, &error);
if (result == BRASERO_BURN_OK) {
NautilusBurnDrive *drive;
......@@ -1502,16 +1480,6 @@ brasero_burn_dialog_run (BraseroBurnDialog *dialog,
&error);
}
if (input_sig) {
g_signal_handler_disconnect (session, input_sig);
input_sig = 0;
}
if (output_sig) {
g_signal_handler_disconnect (session, output_sig);
output_sig = 0;
}
close_dialog = brasero_burn_dialog_end_session (dialog,
result,
error);
......
......@@ -790,7 +790,7 @@ brasero_dest_selection_output_changed (BraseroBurnSession *session,
}
/* make sure the current displayed drive reflects that */
brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (self), &drive);
drive = brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (self));
if (drive && burner && !nautilus_burn_drive_equal (burner, drive)) {
brasero_drive_selection_set_drive (BRASERO_DRIVE_SELECTION (self), drive);
}
......@@ -898,7 +898,7 @@ brasero_dest_selection_set_property (GObject *object,
priv->session = session;
g_object_ref (session);
brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (object), &drive);
drive = brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (object));
brasero_burn_session_set_burner (session, drive);
nautilus_burn_drive_unref (drive);
......
......@@ -98,7 +98,7 @@ brasero_disc_option_dialog_get_default_label (BraseroDiscOptionDialog *dialog)
brasero_burn_session_get_input_type (priv->session, &source);
brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (priv->selection), &drive);
drive = brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (priv->selection));
media = NCB_MEDIA_GET_STATUS (drive);
t = time (NULL);
......
......@@ -228,12 +228,12 @@ brasero_drive_selection_set_drive (BraseroDriveSelection *self,
drive);
}
void
brasero_drive_selection_get_drive (BraseroDriveSelection *self,
NautilusBurnDrive **drive)
NautilusBurnDrive *
brasero_drive_selection_get_drive (BraseroDriveSelection *self)
{
GtkTreeIter iter;
GtkTreeModel *model;
NautilusBurnDrive *drive;
BraseroDriveSelectionPrivate *priv;
priv = BRASERO_DRIVE_SELECTION_PRIVATE (self);
......@@ -241,17 +241,16 @@ brasero_drive_selection_get_drive (BraseroDriveSelection *self,
/* This is a hack to work around the inability of ncb to return the
* current selected drive while we're initting an object derived from it
*/
if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->selection), &iter)) {
*drive = NULL;
return;
}
if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->selection), &iter))
return NULL;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->selection));
gtk_tree_model_get (model, &iter,
1, drive,
1, &drive,
-1);
nautilus_burn_drive_ref (*drive);
nautilus_burn_drive_ref (drive);
return drive;
}
void
......@@ -272,7 +271,7 @@ brasero_drive_selection_lock (BraseroDriveSelection *self,
if (locked) {
NautilusBurnDrive *drive;
brasero_drive_selection_get_drive (self, &drive);
drive = brasero_drive_selection_get_drive (self);
priv->locked_drive = drive;
if (priv->locked_drive)
nautilus_burn_drive_lock (priv->locked_drive,
......@@ -355,7 +354,7 @@ brasero_drive_selection_init (BraseroDriveSelection *object)
FALSE,
0);
brasero_drive_selection_get_drive (object, &drive);
drive = brasero_drive_selection_get_drive (object);
brasero_drive_info_set_drive (BRASERO_DRIVE_INFO (priv->info), drive);
nautilus_burn_drive_unref (drive);
......
......@@ -70,9 +70,9 @@ void
brasero_drive_selection_set_drive (BraseroDriveSelection *selection,
NautilusBurnDrive *drive);
void
brasero_drive_selection_get_drive (BraseroDriveSelection *selection,
NautilusBurnDrive **drive);
NautilusBurnDrive *
brasero_drive_selection_get_drive (BraseroDriveSelection *selection);
void
brasero_drive_selection_get_media (BraseroDriveSelection *selection,
BraseroMedia *media);
......
......@@ -284,8 +284,7 @@ brasero_image_option_dialog_set_formats (BraseroImageOptionDialog *dialog)
/* get the available image types */
output.type = BRASERO_TRACK_TYPE_DISC;
brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (priv->selection),
&drive);
drive = brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (priv->selection));
output.subtype.media = NCB_MEDIA_GET_STATUS (drive);
nautilus_burn_drive_unref (drive);
......
......@@ -239,7 +239,7 @@ command_thread_start (void *arg)
if (g_spawn_sync (NULL,
(char **) data->argv->pdata,
NULL,
G_SPAWN_STDOUT_TO_DEV_NULL|G_SPAWN_STDERR_TO_DEV_NULL,
0,
NULL, NULL,
NULL,
NULL,
......@@ -322,7 +322,7 @@ launch_command (NautilusBurnDrive *drive,
if (data->error)
g_propagate_error (error, data->error);
else if (!command_ok)
else
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
......@@ -419,8 +419,10 @@ NCB_VOLUME_GET_MOUNT_POINT (NautilusBurnDrive *drive,
if (!mount_point || strncmp (mount_point, "file://", 7)) {
/* mount point won't be usable */
if (mount_point)
if (mount_point) {
g_free (mount_point);
mount_point = NULL;
}
g_set_error (error,
BRASERO_BURN_ERROR,
......@@ -647,6 +649,7 @@ NCB_INIT (void)
BRASERO_MEDIUM_KEY,
medium);
}
g_list_free (list);
g_signal_connect (monitor,
"media-added",
......
......@@ -122,7 +122,7 @@ brasero_src_selection_set_property (GObject *object,
brasero_track_set_drive_source (priv->track, NULL);
brasero_burn_session_add_track (priv->session, priv->track);
brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (object), &drive);
drive = brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (object));
if (drive) {
brasero_src_selection_drive_changed (BRASERO_DRIVE_SELECTION (object), drive);
nautilus_burn_drive_unref (drive);
......
......@@ -211,8 +211,7 @@ brasero_tool_dialog_run (BraseroToolDialog *self)
gboolean close = FALSE;
GdkCursor *cursor;
brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (self->priv->selector),
&drive);
drive = brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (self->priv->selector));
/* set up */
gtk_widget_set_sensitive (self->priv->upper_box, FALSE);
......@@ -327,10 +326,7 @@ brasero_tool_dialog_set_button (BraseroToolDialog *self,
NautilusBurnDrive *
brasero_tool_dialog_get_drive (BraseroToolDialog *self)
{
NautilusBurnDrive *drive = NULL;
brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (self->priv->selector), &drive);
return drive;
return brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (self->priv->selector));
}
static void
......
......@@ -654,14 +654,14 @@ brasero_burn_caps_new_checksuming_task (BraseroBurnCaps *self,
GSList *iter;
brasero_burn_session_get_input_type (session, &input);
BRASERO_BURN_LOG_WITH_TYPE (&input,
BRASERO_PLUGIN_IO_NONE,
"Creating checksuming task with input");
caps = brasero_caps_find_start_caps (&input);
if (!caps)
BRASERO_BURN_CAPS_NOT_SUPPORTED_LOG_ERROR (session, error);
BRASERO_BURN_LOG_WITH_TYPE (&caps->type,
BRASERO_PLUGIN_IO_NONE,
"Creating checksuming task with input");
tracks = brasero_burn_session_get_tracks (session);
if (g_slist_length (tracks) != 1) {
g_set_error (error,
......
......@@ -127,6 +127,38 @@ brasero_job_item_previous (BraseroTaskItem *item)
return BRASERO_TASK_ITEM (priv->previous);
}
static gboolean
brasero_job_is_last_running (BraseroJob *self)
{
BraseroJobPrivate *priv, *priv_next;
priv = BRASERO_JOB_PRIVATE (self);
if (!priv->next)
return TRUE;
priv_next = BRASERO_JOB_PRIVATE (priv->next);
if (!priv_next->ctx)
return TRUE;
return FALSE;
}
static gboolean
brasero_job_is_first_running (BraseroJob *self)
{
BraseroJobPrivate *priv, *priv_prev;
priv = BRASERO_JOB_PRIVATE (self);
if (!priv->previous)
return TRUE;
priv_prev = BRASERO_JOB_PRIVATE (priv->previous);
if (!priv_prev->ctx)
return TRUE;
return FALSE;
}
static BraseroBurnResult
brasero_job_item_connect (BraseroTaskItem *input,
BraseroTaskItem *output)
......@@ -156,7 +188,6 @@ brasero_job_set_output (BraseroJob *self,
if (priv->next) {
BraseroJobPrivate *next_priv;
long flags = 0;
int fd [2];
BRASERO_BURN_LOG ("Creating pipe between %s and %s",
......@@ -178,43 +209,8 @@ brasero_job_set_output (BraseroJob *self,
return BRASERO_BURN_ERR;
}
if (fcntl (fd [0], F_GETFL, &flags) != -1) {
flags |= O_NONBLOCK;
if (fcntl (fd [0], F_SETFL, flags) == -1) {
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
_("couldn't set non blocking mode"));