[brasero] Remove the DONT_OVERWRITE flag as it's the application responsibility to make sure the library won't



commit 785d69b8ab2061bc402744627f9d065cf736dfa3
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon May 18 12:00:00 2009 +0200

    Remove the DONT_OVERWRITE flag as it's the application responsibility to make sure the library won't overwrite an existing file.
    This fixes #582145 â?? Replace existing image in copying DVD fails
---
 libbrasero-burn/brasero-caps-session.c |    3 +--
 libbrasero-burn/brasero-enums.h        |   21 ++++++++++-----------
 libbrasero-burn/brasero-session-cfg.c  |    1 -
 libbrasero-burn/burn-debug.c           |    2 --
 libbrasero-burn/burn-job.c             |   30 ------------------------------
 5 files changed, 11 insertions(+), 46 deletions(-)

diff --git a/libbrasero-burn/brasero-caps-session.c b/libbrasero-burn/brasero-caps-session.c
index 61fbe5f..273e51f 100644
--- a/libbrasero-burn/brasero-caps-session.c
+++ b/libbrasero-burn/brasero-caps-session.c
@@ -1482,8 +1482,7 @@ brasero_burn_session_get_burn_flags (BraseroBurnSession *session,
 	BraseroBurnFlag session_flags;
 	/* FIXME: what's the meaning of NOGRACE when outputting ? */
 	BraseroBurnFlag compulsory_flags = BRASERO_BURN_FLAG_NONE;
-	BraseroBurnFlag supported_flags = BRASERO_BURN_FLAG_DONT_OVERWRITE|
-					  BRASERO_BURN_FLAG_CHECK_SIZE|
+	BraseroBurnFlag supported_flags = BRASERO_BURN_FLAG_CHECK_SIZE|
 					  BRASERO_BURN_FLAG_NOGRACE;
 
 	self = brasero_burn_caps_get_default ();
diff --git a/libbrasero-burn/brasero-enums.h b/libbrasero-burn/brasero-enums.h
index e29e462..064c735 100644
--- a/libbrasero-burn/brasero-enums.h
+++ b/libbrasero-burn/brasero-enums.h
@@ -57,22 +57,21 @@ typedef enum {
 	/* These flags should always be supported */
 	BRASERO_BURN_FLAG_EJECT			= 1,
 	BRASERO_BURN_FLAG_NOGRACE		= 1 << 1,
-	BRASERO_BURN_FLAG_DONT_OVERWRITE	= 1 << 2,
-	BRASERO_BURN_FLAG_CHECK_SIZE		= 1 << 3,
+	BRASERO_BURN_FLAG_CHECK_SIZE		= 1 << 2,
 
 	/* These are of great importance for the result */
-	BRASERO_BURN_FLAG_MERGE			= 1 << 4,
-	BRASERO_BURN_FLAG_MULTI			= 1 << 5,
-	BRASERO_BURN_FLAG_APPEND		= 1 << 6,
+	BRASERO_BURN_FLAG_MERGE			= 1 << 3,
+	BRASERO_BURN_FLAG_MULTI			= 1 << 4,
+	BRASERO_BURN_FLAG_APPEND		= 1 << 5,
 
-	BRASERO_BURN_FLAG_BURNPROOF		= 1 << 7,
-	BRASERO_BURN_FLAG_NO_TMP_FILES		= 1 << 8,
-	BRASERO_BURN_FLAG_DUMMY			= 1 << 9,
+	BRASERO_BURN_FLAG_BURNPROOF		= 1 << 6,
+	BRASERO_BURN_FLAG_NO_TMP_FILES		= 1 << 7,
+	BRASERO_BURN_FLAG_DUMMY			= 1 << 8,
 
-	BRASERO_BURN_FLAG_OVERBURN		= 1 << 10,
+	BRASERO_BURN_FLAG_OVERBURN		= 1 << 9,
 
-	BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE	= 1 << 11,
-	BRASERO_BURN_FLAG_FAST_BLANK		= 1 << 12,
+	BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE	= 1 << 10,
+	BRASERO_BURN_FLAG_FAST_BLANK		= 1 << 11,
 
 	/* NOTE: these two are contradictory? */
 	BRASERO_BURN_FLAG_DAO			= 1 << 13,
diff --git a/libbrasero-burn/brasero-session-cfg.c b/libbrasero-burn/brasero-session-cfg.c
index ed56ee3..1605e6c 100644
--- a/libbrasero-burn/brasero-session-cfg.c
+++ b/libbrasero-burn/brasero-session-cfg.c
@@ -264,7 +264,6 @@ brasero_session_cfg_add_drive_properties_flags (BraseroSessionCfg *self,
 
 	/* These are always supported and better be set. */
 	brasero_burn_session_set_flags (BRASERO_BURN_SESSION (self),
-					BRASERO_BURN_FLAG_DONT_OVERWRITE|
 					BRASERO_BURN_FLAG_CHECK_SIZE|
 					BRASERO_BURN_FLAG_NOGRACE);
 
diff --git a/libbrasero-burn/burn-debug.c b/libbrasero-burn/burn-debug.c
index 1db299c..533e0e9 100644
--- a/libbrasero-burn/burn-debug.c
+++ b/libbrasero-burn/burn-debug.c
@@ -147,8 +147,6 @@ brasero_debug_burn_flags_to_string (gchar *buffer,
 		strcat (buffer, "burnproof, ");
 	if (flags & BRASERO_BURN_FLAG_NO_TMP_FILES)
 		strcat (buffer, "no tmp file, ");
-	if (flags & BRASERO_BURN_FLAG_DONT_OVERWRITE)
-		strcat (buffer, "no overwrite, ");
 	if (flags & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE)
 		strcat (buffer, "blank before, ");
 	if (flags & BRASERO_BURN_FLAG_APPEND)
diff --git a/libbrasero-burn/burn-job.c b/libbrasero-burn/burn-job.c
index 4d7fb7a..67c4678 100644
--- a/libbrasero-burn/burn-job.c
+++ b/libbrasero-burn/burn-job.c
@@ -626,36 +626,6 @@ brasero_job_set_output_file (BraseroJob *self,
 				priv->output->toc = toc;
 				return BRASERO_BURN_OK;
 			}
-
-			/* There must be an image at least */
-			if ((flags & BRASERO_BURN_FLAG_DONT_OVERWRITE)
-			&&   g_file_test (image, G_FILE_TEST_EXISTS)) {
-				BRASERO_BURN_LOG ("Problem with image existence");
-				g_set_error (error,
-					     BRASERO_BURN_ERROR,
-					     BRASERO_BURN_ERROR_GENERAL,
-					     _("\"%s\" already exists"),
-					     image);
-				g_free (toc);
-				g_free (image);
-				return BRASERO_BURN_ERR;
-			}
-
-			if (priv->type.subtype.img_format != BRASERO_IMAGE_FORMAT_BIN) {
-				/* There must a toc file in this case */
-				if ((flags & BRASERO_BURN_FLAG_DONT_OVERWRITE)
-				&&   g_file_test (toc, G_FILE_TEST_EXISTS)) {
-					BRASERO_BURN_LOG ("Problem with toc existence");
-					g_set_error (error,
-						     BRASERO_BURN_ERROR,
-						     BRASERO_BURN_ERROR_GENERAL,
-						     _("\"%s\" already exists"),
-						     toc);
-					g_free (toc);
-					g_free (image);
-					return BRASERO_BURN_ERR;
-				}
-			}
 		}
 		else {
 			/* NOTE: no need to check for the existence here */



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