[brasero/gnome-2-28] Make sure to set the label for the volume _after_ the former session has been imported or it get rep



commit fb58e73c154ba10bd5f2569f8848406f8f381bae
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sat Oct 3 14:25:04 2009 +0200

    Make sure to set the label for the volume _after_ the former session has been imported or it get replaced

 plugins/libburnia/burn-libisofs.c |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)
---
diff --git a/plugins/libburnia/burn-libisofs.c b/plugins/libburnia/burn-libisofs.c
index af7a8a8..ba49f07 100644
--- a/plugins/libburnia/burn-libisofs.c
+++ b/plugins/libburnia/burn-libisofs.c
@@ -487,6 +487,7 @@ brasero_libisofs_import_last_session (BraseroLibisofs *self,
 	}
 
 	if (result < 0) {
+		BRASERO_JOB_LOG (self, "Import failed 0x%x", result);
 		g_set_error (error,
 			     BRASERO_BURN_ERROR,
 			     BRASERO_BURN_ERROR_IMAGE_LAST_SESSION,
@@ -548,20 +549,6 @@ brasero_libisofs_create_volume_thread (gpointer data)
 		goto end;
 	}
 
-	publisher = g_strdup_printf ("Brasero-%i.%i.%i",
-				     BRASERO_MAJOR_VERSION,
-				     BRASERO_MINOR_VERSION,
-				     BRASERO_SUB);
-
-	if (label)
-		iso_image_set_volume_id (image, label);
-
-	iso_image_set_publisher_id (image, publisher);
-	iso_image_set_data_preparer_id (image, g_get_real_name ());
-
-	g_free (publisher);
-	g_free (label);
-
 	iso_write_opts_new (&opts, 2);
 
 	brasero_job_get_flags (BRASERO_JOB (self), &flags);
@@ -572,8 +559,10 @@ brasero_libisofs_create_volume_thread (gpointer data)
 							       image,
 							       opts,
 							       &priv->error);
-		if (result != BRASERO_BURN_OK)
+		if (result != BRASERO_BURN_OK) {
+			g_free (label);
 			goto end;
+		}
 	}
 	else if (flags & BRASERO_BURN_FLAG_APPEND) {
 		goffset start_block;
@@ -582,6 +571,21 @@ brasero_libisofs_create_volume_thread (gpointer data)
 		iso_write_opts_set_ms_block (opts, start_block);
 	}
 
+	/* set label but set it after merging so the
+	 * new does not get replaced by the former */
+	publisher = g_strdup_printf ("Brasero-%i.%i.%i",
+				     BRASERO_MAJOR_VERSION,
+				     BRASERO_MINOR_VERSION,
+				     BRASERO_SUB);
+
+	if (label)
+		iso_image_set_volume_id (image, label);
+
+	iso_image_set_publisher_id (image, publisher);
+	iso_image_set_data_preparer_id (image, g_get_real_name ());
+
+	g_free (publisher);
+	g_free (label);
 
 	brasero_job_start_progress (BRASERO_JOB (self), FALSE);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]