brasero r1474 - in trunk: . src src/plugins/checksum src/plugins/libburnia



Author: philippr
Date: Wed Nov  5 13:07:16 2008
New Revision: 1474
URL: http://svn.gnome.org/viewvc/brasero?rev=1474&view=rev

Log:
	Allow use of path or URIs in uri member of BraseroGraftPt structure

	* src/burn-mkisofs-base.c (brasero_mkisofs_base_write_excluded),
	(brasero_mkisofs_base_add_graft),
	(brasero_mkisofs_base_write_to_files):
	* src/plugins/checksum/burn-checksum-files.c
	(brasero_checksum_files_create_checksum):
	* src/plugins/libburnia/burn-libisofs.c
	(brasero_libisofs_create_volume_thread):


Modified:
   trunk/ChangeLog
   trunk/src/burn-mkisofs-base.c
   trunk/src/plugins/checksum/burn-checksum-files.c
   trunk/src/plugins/libburnia/burn-libisofs.c

Modified: trunk/src/burn-mkisofs-base.c
==============================================================================
--- trunk/src/burn-mkisofs-base.c	(original)
+++ trunk/src/burn-mkisofs-base.c	Wed Nov  5 13:07:16 2008
@@ -125,7 +125,19 @@
 	BraseroBurnResult result = BRASERO_BURN_OK;
 
 	/* make sure uri is local: otherwise error out */
-	if (!g_str_has_prefix (uri, "file://")) {
+	/* FIXME: uri can be path or URI? problem with graft->uri */
+	if (uri && uri [0] == '/') {
+		localpath = g_strdup (unescaped_uri);
+	}
+	else if (g_str_has_prefix (uri, "file://")) {
+		gchar *unescaped_uri;
+
+		unescaped_uri = g_uri_unescape_string (uri, NULL);
+		localpath = g_filename_from_uri (unescaped_uri, NULL, NULL);
+		g_free (unescaped_uri);	      
+	}
+	else {
+		BRASERO_BURN_LOG ("File not stored locally %s", uri);
 		g_set_error (error,
 			     BRASERO_BURN_ERROR,
 			     BRASERO_BURN_ERROR_GENERAL,
@@ -133,10 +145,6 @@
 		return BRASERO_BURN_ERR;
 	}
 
-	unescaped_uri = g_uri_unescape_string (uri, NULL);
-	localpath = g_filename_from_uri (unescaped_uri, NULL, NULL);
-	g_free (unescaped_uri);
-
 	if (!localpath) {
 		BRASERO_BURN_LOG ("Localpath is NULL");
 		return BRASERO_BURN_ERR;
@@ -407,8 +415,11 @@
 	GSList *list;
 
 	/* check the file is local */
-	if (!g_str_has_prefix (graft->uri, "file://")) {
+	if (graft->uri
+	&&  graft->uri [0] != '/'
+	&& !g_str_has_prefix (graft->uri, "file://")) {
 		/* Error out, files must be local */
+		BRASERO_BURN_LOG ("File not stored locally %s", graft->uri);
 		g_set_error (error,
 			     BRASERO_BURN_ERROR,
 			     BRASERO_BURN_ERROR_GENERAL,
@@ -556,6 +567,11 @@
 	/* write the global excluded files list */
 	for (; excluded; excluded = excluded->next) {
 		uri = excluded->data;
+		if (!uri) {
+			BRASERO_BURN_LOG ("NULL URI");
+			continue;
+		}
+
 		result = brasero_mkisofs_base_write_excluded (&base,
 							      uri,
 							      error);

Modified: trunk/src/plugins/checksum/burn-checksum-files.c
==============================================================================
--- trunk/src/plugins/checksum/burn-checksum-files.c	(original)
+++ trunk/src/plugins/checksum/burn-checksum-files.c	Wed Nov  5 13:07:16 2008
@@ -586,7 +586,6 @@
 		BraseroGraftPt *graft;
 		gchar *graft_path;
 		gchar *path;
-		gchar *uri;
 
 		if (priv->cancel) {
 			result = BRASERO_BURN_CANCEL;
@@ -598,8 +597,15 @@
 			continue;
 
 		/* get the current and future paths */
-		uri = graft->uri;
-		path = g_filename_from_uri (uri, NULL, NULL);
+		/* FIXME: graft->uri can be path or URIs ... This should be
+		 * fixed for graft points. */
+		if (graft->uri && graft->uri [0] == '/')
+			path = g_strdup (graft->uri);
+		else if (g_str_has_prefix (graft->uri, "file://"))
+			path = g_filename_from_uri (graft->uri, NULL, NULL);
+		else
+			path = NULL;
+
 		graft_path = graft->path;
 
 		if (g_file_test (path, G_FILE_TEST_IS_DIR))

Modified: trunk/src/plugins/libburnia/burn-libisofs.c
==============================================================================
--- trunk/src/plugins/libburnia/burn-libisofs.c	(original)
+++ trunk/src/plugins/libburnia/burn-libisofs.c	Wed Nov  5 13:07:16 2008
@@ -626,7 +626,14 @@
 			gchar *local_path;
 			IsoDirIter *sibling;
 
-			local_path = g_filename_from_uri (graft->uri, NULL, NULL);
+			/* graft->uri can be a path or a URI */
+			if (graft->uri [0] == '/')
+				local_path = g_strdup (graft->uri);
+			else if (g_str_has_prefix (graft->uri, "file://"))
+				local_path = g_filename_from_uri (graft->uri, NULL, NULL);
+			else
+				local_path = NULL;
+
 			if (!local_path){
 				priv->error = g_error_new (BRASERO_BURN_ERROR,
 							   BRASERO_BURN_ERROR_GENERAL,



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