brasero r1053 - in trunk: . src src/plugins/checksum



Author: philippr
Date: Tue Aug  5 16:40:54 2008
New Revision: 1053
URL: http://svn.gnome.org/viewvc/brasero?rev=1053&view=rev

Log:
	Fix a problem with data-project not setting the correct number of files

	* src/brasero-data-disc.c (brasero_data_disc_set_session_contents):
	* src/brasero-file-node.c (brasero_file_node_add),
	(brasero_file_node_set_from_info):
	* src/plugins/checksum/burn-checksum-files.c
	(brasero_checksum_files_check_files):


Modified:
   trunk/ChangeLog
   trunk/src/brasero-data-disc.c
   trunk/src/brasero-file-node.c
   trunk/src/plugins/checksum/burn-checksum-files.c

Modified: trunk/src/brasero-data-disc.c
==============================================================================
--- trunk/src/brasero-data-disc.c	(original)
+++ trunk/src/brasero-data-disc.c	Tue Aug  5 16:40:54 2008
@@ -1292,7 +1292,8 @@
 	/* Set the number of files in the tree */
 	root = brasero_data_project_get_root (priv->project);
 	stats = BRASERO_FILE_NODE_STATS (root);
-	brasero_track_set_data_file_num (track, stats->children);
+	if (stats)
+		brasero_track_set_data_file_num (track, stats->children);
 
 	joliet_compat = (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET);
 	brasero_track_add_data_fs (track, type.subtype.fs_type);

Modified: trunk/src/brasero-file-node.c
==============================================================================
--- trunk/src/brasero-file-node.c	(original)
+++ trunk/src/brasero-file-node.c	Tue Aug  5 16:40:54 2008
@@ -690,7 +690,6 @@
 
 	node->parent = parent;
 	if (!node->is_imported) {
-		BraseroFileTreeStats *stats;
 		guint depth = 0;
 
 		if (!node->is_grafted) {
@@ -702,12 +701,6 @@
 			}
 		}
 
-		stats = brasero_file_node_get_tree_stats (parent, &depth);
-		if (node->is_file) {
-			/* only count files */
-			stats->children ++;
-		}
-
 		if (depth > 6)
 			node->is_deep = TRUE;
 	}
@@ -723,6 +716,15 @@
 	 * creation of a graft). If someone wants to set a new name,
 	 * then rename_node is the function. */
 
+	/* update the stats since a file could have been added to the tree but
+	 * at this point we didn't know what it was (a file or a directory).
+	 * Only do this if it wasn't a file before. */
+	if (!node->is_file
+	&& (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY)) {
+		/* only count files */
+		stats->children ++;
+	}
+
 	/* update :
 	 * - the mime type
 	 * - the size (and possibly the one of his parent)

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	Tue Aug  5 16:40:54 2008
@@ -825,7 +825,9 @@
 			break;
 
 		file_num++;
-		brasero_job_set_progress (BRASERO_JOB (self), (gdouble) file_num / (gdouble) file_nb);
+		brasero_job_set_progress (BRASERO_JOB (self),
+					  (gdouble) file_num /
+					  (gdouble) file_nb);
 		BRASERO_JOB_LOG (self,
 				 "comparing checksums for file %s : %s (from md5 file) / %s (current)",
 				 filename, checksum_file, checksum_real);



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