Author: benny
Date: 2006-07-27 22:49:47 +0000 (Thu, 27 Jul 2006)
New Revision: 22538

Modified:
   thunar/trunk/ChangeLog
   thunar/trunk/thunar/thunar-tree-model.c
Log:
2006-07-28      Benedikt Meurer <[EMAIL PROTECTED]>

        * thunar/thunar-tree-model.c(thunar_tree_model_node_drop_dummy): We
          can avoid an additional path lookup here.




Modified: thunar/trunk/ChangeLog
===================================================================
--- thunar/trunk/ChangeLog      2006-07-27 21:21:25 UTC (rev 22537)
+++ thunar/trunk/ChangeLog      2006-07-27 22:49:47 UTC (rev 22538)
@@ -1,3 +1,8 @@
+2006-07-28     Benedikt Meurer <[EMAIL PROTECTED]>
+
+       * thunar/thunar-tree-model.c(thunar_tree_model_node_drop_dummy): We
+         can avoid an additional path lookup here.
+
 2006-07-27     Benedikt Meurer <[EMAIL PROTECTED]>
 
        * thunar-vfs/thunar-vfs-thumb-pixbuf.c(thunar_vfs_thumb_pixbuf_load):

Modified: thunar/trunk/thunar/thunar-tree-model.c
===================================================================
--- thunar/trunk/thunar/thunar-tree-model.c     2006-07-27 21:21:25 UTC (rev 
22537)
+++ thunar/trunk/thunar/thunar-tree-model.c     2006-07-27 22:49:47 UTC (rev 
22538)
@@ -1473,32 +1473,33 @@
   GtkTreeIter  iter;
 
   /* check if we still have the dummy child node */
-  if (g_node_n_children (node) == 1 && g_node_first_child (node)->data == NULL)
+  if (g_node_n_children (node) == 1 && node->children->data == NULL)
     {
       /* determine the iterator for the dummy */
       iter.stamp = model->stamp;
-      iter.user_data = g_node_first_child (node);
+      iter.user_data = node->children;
 
       /* determine the path for the iterator */
       path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
       if (G_LIKELY (path != NULL))
         {
           /* drop the dummy from the model */
-          g_node_destroy (iter.user_data);
+          g_node_destroy (node->children);
 
           /* notify the view */
           gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path);
 
-          /* release the path */
-          gtk_tree_path_free (path);
-
           /* determine the iter to the parent node */
           iter.stamp = model->stamp;
           iter.user_data = node;
 
+          /* determine the path to the parent node */
+          gtk_tree_path_up (path);
+
           /* emit a "row-has-child-toggled" for the parent */
-          path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
           gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (model), path, 
&iter);
+
+          /* release the path */
           gtk_tree_path_free (path);
         }
     }

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to