brasero r791 - in trunk: . src



Author: philippr
Date: Sun May  4 11:54:28 2008
New Revision: 791
URL: http://svn.gnome.org/viewvc/brasero?rev=791&view=rev

Log:
	Fix #530815 â Unable to burn bin/cue

	* src/brasero-image-option-dialog.c
	(brasero_image_option_dialog_set_image_uri):
	* src/burn-image-format.c (brasero_image_format_get_DATAFILE_info),
	(brasero_image_format_get_FILE_info),
	(brasero_image_format_get_cdrdao_size),
	(brasero_image_format_get_cue_size):

Modified:
   trunk/ChangeLog
   trunk/src/brasero-image-option-dialog.c
   trunk/src/burn-image-format.c

Modified: trunk/src/brasero-image-option-dialog.c
==============================================================================
--- trunk/src/brasero-image-option-dialog.c	(original)
+++ trunk/src/brasero-image-option-dialog.c	Sun May  4 11:54:28 2008
@@ -321,11 +321,8 @@
 	priv = BRASERO_IMAGE_OPTION_DIALOG_PRIVATE (dialog);
 
 	brasero_image_option_dialog_set_formats (dialog);
-
-	if (uri) {
+	if (uri)
 		gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (priv->file), uri);
-		brasero_image_option_dialog_changed (dialog);
-	}
 	else
 		brasero_image_option_dialog_set_track (dialog,
 						       BRASERO_IMAGE_FORMAT_NONE,

Modified: trunk/src/burn-image-format.c
==============================================================================
--- trunk/src/burn-image-format.c	(original)
+++ trunk/src/burn-image-format.c	Sun May  4 11:54:28 2008
@@ -259,6 +259,7 @@
 
 static gboolean
 brasero_image_format_get_DATAFILE_info (const gchar *ptr,
+					const gchar *parent,
 					gint64 *size,
 					GError **error)
 {
@@ -266,7 +267,8 @@
 	gchar *path;
 	int res;
 
-	/* get the path */
+	/* get the path. NOTE: no need to check if it's relative since that's
+	 * just to skip it. */
 	ptr = brasero_image_format_read_path (ptr, &path);
 	if (!ptr)
 		return FALSE;
@@ -285,6 +287,18 @@
 
 stat_end:
 
+	/* check if the path is relative, if so then add the root path */
+	if (path && !g_path_is_absolute (path)) {
+		gchar *tmp;
+
+		tmp = path;
+		path = g_build_path (G_DIR_SEPARATOR_S,
+				     parent,
+				     path,
+				     NULL);
+		g_free (tmp);
+	}
+
 	/* if size is skipped then g_lstat () the file */
 	res = g_lstat (path, &buffer);
 	g_free (path);
@@ -306,6 +320,7 @@
 
 static gboolean
 brasero_image_format_get_FILE_info (const gchar *ptr,
+				    const gchar *parent,
 				    gint64 *size,
 				    GError **error)
 {
@@ -315,7 +330,7 @@
 	gchar *tmp;
 	int res;
 
-	/* get the path */
+	/* get the path and skip it */
 	ptr = brasero_image_format_read_path (ptr, &path);
 	if (!ptr)
 		return FALSE;
@@ -356,6 +371,18 @@
 
 stat_end:
 
+	/* check if the path is relative, if so then add the root path */
+	if (path && !g_path_is_absolute (path)) {
+		gchar *tmp;
+
+		tmp = path;
+		path = g_build_path (G_DIR_SEPARATOR_S,
+				     parent,
+				     path,
+				     NULL);
+		g_free (tmp);
+	}
+
 	/* if size is skipped then g_lstat () the file */
 	res = g_lstat (path, &buffer);
 	g_free (path);
@@ -382,6 +409,7 @@
 				      GError **error)
 {
 	FILE *file;
+	gchar *parent;
 	gint64 cue_size = 0;
 	gchar buffer [MAXPATHLEN * 2];
 
@@ -397,6 +425,7 @@
 		return FALSE;
 	}
 
+	parent = g_path_get_dirname (path);
 	while (fgets (buffer, sizeof (buffer), file)) {
 		gchar *ptr;
 
@@ -405,7 +434,7 @@
 			gint64 size;
 
 			ptr += 8;
-			if (!brasero_image_format_get_DATAFILE_info (ptr, &size, error))
+			if (!brasero_image_format_get_DATAFILE_info (ptr, parent, &size, error))
 				continue;
 
 			cue_size += size;
@@ -419,7 +448,7 @@
 			ptr += 4;
 			/* first number is the position, the second the size,
 			 * number after '#' is the offset (in bytes). */
-			if (!brasero_image_format_get_FILE_info (ptr, &size, error))
+			if (!brasero_image_format_get_FILE_info (ptr, parent, &size, error))
 				continue;
 
 			cue_size += size;
@@ -433,7 +462,7 @@
 			ptr += 4;
 			/* first number is the position, the second the size,
 			 * number after '#' is the offset (in bytes). */
-			if (!brasero_image_format_get_FILE_info (ptr, &size, error))
+			if (!brasero_image_format_get_FILE_info (ptr, parent, &size, error))
 				continue;
 
 			cue_size += size;
@@ -482,6 +511,7 @@
 			cue_size += size;
 		}
 	}
+	g_free (parent);
 
 	fclose (file);
 
@@ -538,6 +568,21 @@
 			if (!ptr)
 				return FALSE;
 
+			/* check if the path is relative, if so then add the root path */
+			if (file_path && !g_path_is_absolute (file_path)) {
+				gchar *directory;
+				gchar *tmp;
+
+				directory = g_path_get_dirname (path);
+
+				tmp = file_path;
+				file_path = g_build_path (G_DIR_SEPARATOR_S,
+							  directory,
+							  file_path,
+							  NULL);
+				g_free (tmp);
+			}
+
 			res = g_lstat (file_path, &buffer);
 			if (res == -1) {
 				g_set_error (error,



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