brasero r1816 - in trunk: . src



Author: philippr
Date: Fri Jan 23 16:56:38 2009
New Revision: 1816
URL: http://svn.gnome.org/viewvc/brasero?rev=1816&view=rev

Log:
2009-01-23  Philippe Rouquier  <ykw localhost localdomain>

	Fix loading (and quiet warnings) when loading project with fake directories 

	* src/brasero-data-project.c
	(brasero_data_project_load_contents_notify_directory),
	(brasero_data_project_load_contents):

Modified:
   trunk/ChangeLog
   trunk/src/brasero-data-project.c

Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c	(original)
+++ trunk/src/brasero-data-project.c	Fri Jan 23 16:56:38 2009
@@ -2855,6 +2855,7 @@
 
 	child = BRASERO_FILE_NODE_CHILDREN (parent);
 	while (child) {
+		gchar *uri;
 		gboolean res;
 		BraseroFileNode *next;
 
@@ -2868,18 +2869,19 @@
 		 * means they must not be fake).
 		 * +1 for loading the directory contents.
 		 */
-		if (!child->is_fake) {
-			gchar *uri;
+		if (child->is_fake) {
+			/* This is a fake directory, there is no operation */
+			res = func (self, child, NULL);
+			child = next;
+			continue;
+		}
 
-			uri = brasero_data_project_node_to_uri (self, child);
-			res = func (self, child, uri);
-			g_free (uri);
+		uri = brasero_data_project_node_to_uri (self, child);
+		res = func (self, child, uri);
+		g_free (uri);
 
-			if (res)
-				num ++;
-		}
-		else
-			res = func (self, child, NULL);
+		if (res)
+			num ++;
 
 		/* for whatever reason the node could have been invalidated */
 		if (res && !child->is_file) {
@@ -2936,15 +2938,21 @@
 
 		graft = iter->data;
 
-		file = g_file_new_for_uri (graft->uri);
-		uri = g_file_get_uri (file);
-		g_object_unref (file);
+		if (graft->uri) {
+			file = g_file_new_for_uri (graft->uri);
+			uri = g_file_get_uri (file);
+			g_object_unref (file);
+		}
+		else
+			uri = NULL;
 
 		folders = brasero_data_project_add_path (self,
 							 graft->path,
 							 uri,
 							 folders);
-		g_free (uri);
+
+		if (uri)
+			g_free (uri);
 	}
 
 	for (iter = excluded; iter; iter = iter->next) {



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