[maemo-commits] [maemo-commits] r18227 - in projects/haf/branches/gtk+/hildon-fm-optimization-test: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon May 4 16:54:10 EEST 2009
Author: kris
Date: 2009-05-04 16:54:08 +0300 (Mon, 04 May 2009)
New Revision: 18227

Modified:
   projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog
   projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreeview.c
Log:
2009-05-04  Kristian Rietveld  <kris at imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_button_release): when
	expanding/collapsing a node in fremantle mode, do not compare
	the path with the cursor path.



Modified: projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog
===================================================================
--- projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog	2009-05-04 13:52:20 UTC (rev 18226)
+++ projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog	2009-05-04 13:54:08 UTC (rev 18227)
@@ -1,5 +1,11 @@
 2009-05-04  Kristian Rietveld  <kris at imendio.com>
 
+	* gtk/gtktreeview.c (gtk_tree_view_button_release): when
+	expanding/collapsing a node in fremantle mode, do not compare
+	the path with the cursor path.
+
+2009-05-04  Kristian Rietveld  <kris at imendio.com>
+
 	* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_get_nth_visible):
 	if the level does not have any invisible nodes, directly access
 	the array.

Modified: projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreeview.c
===================================================================
--- projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreeview.c	2009-05-04 13:52:20 UTC (rev 18226)
+++ projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreeview.c	2009-05-04 13:54:08 UTC (rev 18227)
@@ -3619,28 +3619,40 @@
 
   if (gtk_tree_row_reference_valid (tree_view->priv->queued_expand_row))
     {
-      GtkTreePath *path, *cursor_path;
+      GtkTreePath *path;
+      GtkRBTree *tree;
+      GtkRBNode *node = NULL;
 
       path = gtk_tree_row_reference_get_path (tree_view->priv->queued_expand_row);
-      cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
 
-      if (!gtk_tree_path_compare (cursor_path, path))
+      if (mode == HILDON_FREMANTLE)
         {
-	  GtkRBTree *tree;
-	  GtkRBNode *node;
+          /* We should not take the cursor into accont. */
+          _gtk_tree_view_find_node (tree_view, path, &tree, &node);
+        }
+      else
+        {
+          GtkTreePath *cursor_path;
 
-	  _gtk_tree_view_find_node (tree_view, path, &tree, &node);
+          cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
 
-	  if (!node->children)
-	    gtk_tree_view_real_expand_row (tree_view, path,
-					   tree, node, FALSE, TRUE);
-	  else
-	    gtk_tree_view_real_collapse_row (tree_view, path,
-					     tree, node, TRUE);
-	}
+          if (!gtk_tree_path_compare (cursor_path, path))
+            _gtk_tree_view_find_node (tree_view, path, &tree, &node);
 
+          gtk_tree_path_free (cursor_path);
+        }
+
+      if (node)
+        {
+          if (!node->children)
+            gtk_tree_view_real_expand_row (tree_view, path,
+                                           tree, node, FALSE, TRUE);
+          else
+            gtk_tree_view_real_collapse_row (tree_view, path,
+                                             tree, node, TRUE);
+        }
+
       gtk_tree_path_free (path);
-      gtk_tree_path_free (cursor_path);
 
       gtk_tree_row_reference_free (tree_view->priv->queued_expand_row);
       tree_view->priv->queued_expand_row = NULL;


More information about the maemo-commits mailing list