[Gnucash-changes] r13353 - gnucash/trunk - Two fixes from Andreas Köhler. One fixes 331183, the problem where

David Hampton hampton at cvs.gnucash.org
Tue Feb 21 18:58:16 EST 2006


Author: hampton
Date: 2006-02-21 18:58:16 -0500 (Tue, 21 Feb 2006)
New Revision: 13353
Trac: http://svn.gnucash.org/trac/changeset/13353

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c
Log:
Two fixes from Andreas Köhler.  One fixes 331183, the problem where
editing a top-level account doesn't set the current parent.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-02-21 23:10:33 UTC (rev 13352)
+++ gnucash/trunk/ChangeLog	2006-02-21 23:58:16 UTC (rev 13353)
@@ -1,3 +1,9 @@
+2006-02-21  David Hampton  <hampton at employees.org>
+
+	* src/gnome-utils/gnc-tree-model-account.c: Two fixes from Andreas
+	Köhler.  One fixes 331183, the problem where editing a top-level
+	account doesn't set the current parent.
+
 2006-02-21  Joshua Sled  <jsled at asynchronous.org>
 
 	* lib/libqof/qof/qofevent.[ch] (QOF_DEFAULT_EVENT_LIMIT): rename, set
@@ -22,7 +28,7 @@
 
 	* src/register/register-gnome/gnucash-date-picker.c: Andreas
 	Köhler's patch to prevent a crash in the register date picker
-	widget when using gtk 2.8..
+	widget when using gtk 2.8.
 
 	* src/bin/gnucash-bin.c:
 	* src/gnome-utils/glade/commodity.glade:

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c	2006-02-21 23:10:33 UTC (rev 13352)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c	2006-02-21 23:58:16 UTC (rev 13353)
@@ -1298,15 +1298,10 @@
 	g_return_val_if_fail ((account != NULL), FALSE);
 	g_return_val_if_fail ((iter != NULL), FALSE);
 
-	priv = GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(model);
-	if (priv->root != xaccAccountGetRoot (account)) {
-		LEAVE("Root doesn't match");
-		return FALSE;
-	}
-
 	iter->user_data = account;
 	iter->stamp = model->stamp;
 
+	priv = GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(model);
 	if (account == priv->toplevel) {
 		iter->user_data2 = NULL;
 		iter->user_data3 = GINT_TO_POINTER (0);
@@ -1314,6 +1309,11 @@
 		return TRUE;
 	}
 
+	if (priv->root != xaccAccountGetRoot (account)) {
+		LEAVE("Root doesn't match");
+		return FALSE;
+	}
+
 	group = xaccAccountGetParent (account);
 	DEBUG("Looking through %d accounts at this level", 
               xaccGroupGetNumAccounts (group));
@@ -1407,9 +1407,10 @@
   GtkTreeIter iter;
 
   if (gtk_tree_path_up (path)) {
-    if (gtk_tree_model_get_iter (GTK_TREE_MODEL(model), &iter, path))
+    if (gtk_tree_model_get_iter (GTK_TREE_MODEL(model), &iter, path)) {
       gtk_tree_model_row_changed (GTK_TREE_MODEL(model), path, &iter);
       gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL(model), path, &iter);
+    }
   }
 
   do {



More information about the gnucash-changes mailing list