brasero r1485 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1485 - in trunk: . src
- Date: Fri, 7 Nov 2008 11:11:52 +0000 (UTC)
Author: philippr
Date: Fri Nov 7 11:11:52 2008
New Revision: 1485
URL: http://svn.gnome.org/viewvc/brasero?rev=1485&view=rev
Log:
Fix for #543377 â No multisession (last comment)
* src/brasero-data-project.c (brasero_data_project_is_deep),
(brasero_data_project_move_node),
(brasero_data_project_add_empty_directory),
(brasero_data_project_node_loaded),
(brasero_data_project_add_node_from_info),
(brasero_data_project_file_moved):
* src/brasero-file-node.c (brasero_file_node_add),
(brasero_file_node_move_to):
Modified:
trunk/ChangeLog
trunk/src/brasero-data-project.c
trunk/src/brasero-file-node.c
Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c (original)
+++ trunk/src/brasero-data-project.c Fri Nov 7 11:11:52 2008
@@ -1238,6 +1238,44 @@
* used to remove imported nodes. */
}
+static gboolean
+brasero_data_project_is_deep (BraseroDataProject *self,
+ BraseroFileNode *parent,
+ const gchar *name,
+ gboolean isfile)
+{
+ gint parent_depth;
+ BraseroFileTreeStats *stats;
+ BraseroDataProjectPrivate *priv;
+
+ priv = BRASERO_DATA_PROJECT_PRIVATE (self);
+
+ /* if there are already deep files accepts new ones (includes the
+ * possible imported ones. */
+ stats = brasero_file_node_get_tree_stats (priv->root, NULL);
+ if (stats->num_deep)
+ return TRUE;
+
+ /* This node could have been moved beyond the depth 6 only in one case,
+ * which is with imported directories. Otherwise since we check
+ * directories for a depth of 5, its parent would have already been
+ * detected. */
+ parent_depth = brasero_file_node_get_depth (parent);
+ if (!isfile) {
+ if (parent_depth < 5)
+ return TRUE;
+ }
+ else {
+ if (parent_depth < 6)
+ return TRUE;
+ }
+
+ if (brasero_data_project_file_signal (self, DEEP_DIRECTORY_SIGNAL, name))
+ return FALSE;
+
+ return TRUE;
+}
+
gboolean
brasero_data_project_move_node (BraseroDataProject *self,
BraseroFileNode *node,
@@ -1268,8 +1306,7 @@
return FALSE;
/* see if we won't break the max path depth barrier */
- if (!node->is_file && brasero_file_node_get_depth (parent) == 5
- && brasero_data_project_file_signal (self, DEEP_DIRECTORY_SIGNAL, BRASERO_FILE_NODE_NAME (node)))
+ if (!brasero_data_project_is_deep (self, parent, BRASERO_FILE_NODE_NAME (node), node->is_file))
return FALSE;
/* One case could make us fail: if there is the same name in
@@ -1685,10 +1722,8 @@
parent = priv->root;
/* check directory_depth */
- if (brasero_file_node_get_depth (parent) == 5) {
- if (brasero_data_project_file_signal (self, DEEP_DIRECTORY_SIGNAL, name))
- return NULL;
- }
+ if (!brasero_data_project_is_deep (self, parent, name, FALSE))
+ return NULL;
node = brasero_file_node_check_name_existence (parent, name);
if (node) {
@@ -1852,10 +1887,9 @@
}
}
}
+
/* avoid signalling twice for the same directory */
- else if (!node->is_file
- && brasero_file_node_get_depth (node) == 6
- && brasero_data_project_file_signal (self, DEEP_DIRECTORY_SIGNAL, g_file_info_get_name (info))) {
+ if (!brasero_data_project_is_deep (self, node->parent, BRASERO_FILE_NODE_NAME (node), node->is_file)) {
brasero_data_project_remove_node (self, node);
return;
}
@@ -2036,6 +2070,10 @@
}
}
+
+/* This function is only used in brasero-data-vfs.c to add new nodes
+ * discovered through exploration */
+
BraseroFileNode *
brasero_data_project_add_node_from_info (BraseroDataProject *self,
const gchar *uri,
@@ -2107,10 +2145,15 @@
if (brasero_data_project_file_signal (self, G2_FILE_SIGNAL, name))
return NULL;
}
+ /* This is a special case where we won't try all checks for deep nested
+ * files. Since this function is only used by brasero-data-vfs.c to
+ * add the results of its exploration, we only check directories and
+ * just check for a directory to have a depth of 6 (means parent has a
+ * depth of 5. */
else if (brasero_file_node_get_depth (parent) == 5) {
if (brasero_data_project_file_signal (self, DEEP_DIRECTORY_SIGNAL, name))
return NULL;
- }
+ }
node = brasero_file_node_new_from_info (info, parent, priv->sort_func);
if (node->is_symlink) {
@@ -3440,8 +3483,7 @@
brasero_data_project_joliet_remove_node (BRASERO_DATA_PROJECT (monitor), node);
/* see if we won't break the max path depth barrier */
- if (!node->is_file && brasero_file_node_get_depth (parent) == 5
- && brasero_data_project_file_signal (BRASERO_DATA_PROJECT (monitor), DEEP_DIRECTORY_SIGNAL, BRASERO_FILE_NODE_NAME (node))) {
+ if (!brasero_data_project_is_deep (BRASERO_DATA_PROJECT (monitor), parent, BRASERO_FILE_NODE_NAME (node), node->is_file)) {
brasero_data_project_remove_node (BRASERO_DATA_PROJECT (monitor), node);
return;
}
Modified: trunk/src/brasero-file-node.c
==============================================================================
--- trunk/src/brasero-file-node.c (original)
+++ trunk/src/brasero-file-node.c Fri Nov 7 11:11:52 2008
@@ -693,15 +693,15 @@
BraseroFileNode *node,
GCompareFunc sort_func)
{
+ BraseroFileTreeStats *stats;
+ guint depth = 0;
+
parent->union2.children = brasero_file_node_insert (BRASERO_FILE_NODE_CHILDREN (parent),
node,
sort_func,
NULL);
node->parent = parent;
if (!node->is_imported) {
- guint depth = 0;
- BraseroFileTreeStats *stats;
-
/* NOTE: parent will be changed afterwards !!! */
if (!node->is_grafted) {
/* propagate the size change*/
@@ -711,13 +711,19 @@
break;
}
}
+ }
- stats = brasero_file_node_get_tree_stats (node->parent, &depth);
- if (depth == 5) {
- stats->num_deep ++;
- node->is_deep = TRUE;
- }
+ /* even imported should be included */
+ stats = brasero_file_node_get_tree_stats (node->parent, &depth);
+ if (node->is_file) {
+ if (depth < 6)
+ return;
}
+ else if (depth < 5)
+ return;
+
+ stats->num_deep ++;
+ node->is_deep = TRUE;
}
void
@@ -1007,10 +1013,15 @@
/* NOTE: here stats about the tree can change if the parent has a depth
* > 6 and if previous didn't. Other stats remains unmodified. */
stats = brasero_file_node_get_tree_stats (node->parent, &depth);
- if (depth == 5) {
- stats->num_deep ++;
- node->is_deep = TRUE;
+ if (node->is_file) {
+ if (depth < 6)
+ return;
}
+ else if (depth < 5)
+ return;
+
+ stats->num_deep ++;
+ node->is_deep = TRUE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]