r14893 - gnucash/trunk - Revert r14591 (bug 344966) to prepare another solution.

Andreas Köhler andi5 at cvs.gnucash.org
Tue Sep 26 18:07:44 EDT 2006


Author: andi5
Date: 2006-09-26 18:07:42 -0400 (Tue, 26 Sep 2006)
New Revision: 14893
Trac: http://svn.gnucash.org/trac/changeset/14893

Modified:
   gnucash/trunk/
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/dialog-account.c
Log:
Revert r14591 (bug 344966) to prepare another solution.



Property changes on: gnucash/trunk
___________________________________________________________________
Name: svk:merge
   - d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13351
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:638
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13351

Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-09-26 00:36:30 UTC (rev 14892)
+++ gnucash/trunk/ChangeLog	2006-09-26 22:07:42 UTC (rev 14893)
@@ -179,9 +179,6 @@
 
 	* various: Unref all new stores.
 
-	* src/gnome-utils/dialog-account.c: Check for account type
-	  compatibility when creating a new account. Fixes 344966.
-
 	* src/core-utils/gnc-gtk-utils.c: Unref entry completion, inline
 	  completion only for gtk>=2.6.
 

Modified: gnucash/trunk/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.c	2006-09-26 00:36:30 UTC (rev 14892)
+++ gnucash/trunk/src/gnome-utils/dialog-account.c	2006-09-26 22:07:42 UTC (rev 14893)
@@ -497,8 +497,8 @@
 /* Record all of the children of the given account as needing their
  * type changed to the one specified. */
 static void
-gnc_change_account_types(GHashTable *change_type, Account *account,
-                         Account *except, GNCAccountType type)
+gnc_edit_change_account_types(GHashTable *change_type, Account *account,
+                              Account *except, GNCAccountType type)
 {
   AccountGroup *children;
   GList *list;
@@ -521,7 +521,7 @@
   for (node= list; node; node = node->next)
   {
     account = node->data;
-    gnc_change_account_types(change_type, account, except, type);
+    gnc_edit_change_account_types(change_type, account, except, type);
   }
 }
 
@@ -640,7 +640,8 @@
   store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_STRING, G_TYPE_STRING,
 			     G_TYPE_STRING, G_TYPE_STRING);
 
-  size = fill_list(account, GTK_LIST_STORE(store), change_type);
+  size = 0;
+  size += fill_list(account, GTK_LIST_STORE(store), change_type);
 
   if (size == 0)
   {
@@ -887,7 +888,7 @@
     change_all = FALSE;
 
   if (change_children)
-    gnc_change_account_types(change_type, account, NULL, aw->type);
+    gnc_edit_change_account_types(change_type, account, NULL, aw->type);
 
   if (change_all)
   {
@@ -902,7 +903,7 @@
       temp = xaccAccountGetParentAccount(ancestor);
     } while (temp != NULL);
 
-    gnc_change_account_types(change_type, ancestor, account, aw->type);
+    gnc_edit_change_account_types(change_type, ancestor, account, aw->type);
   }
 
   if (!extra_change_verify(aw, change_type))
@@ -927,8 +928,6 @@
 gnc_new_account_ok (AccountWindow *aw)
 {
   gnc_numeric balance;
-  GHashTable *change_type;
-  Account *new_parent;
 
   ENTER("aw %p", aw);
 
@@ -972,41 +971,7 @@
     }
   }
 
-  /* If the new parent's type is not compatible with the new type,
-   * the whole sub-tree containing the account must be re-typed. */
-  change_type = g_hash_table_new (NULL, NULL);
-
-  new_parent = gnc_tree_view_account_get_selected_account (
-    GNC_TREE_VIEW_ACCOUNT (aw->parent_tree));
-  if (new_parent != aw->top_level_account)
-  {
-    if (!xaccAccountTypesCompatible (xaccAccountGetType(new_parent),
-                                     aw->type))
-    {
-      Account *ancestor;
-      Account *temp;
-
-      temp = new_parent;
-      do
-      {
-        ancestor = temp;
-        temp = xaccAccountGetParentAccount (ancestor);
-      } while (temp != NULL);
-
-      gnc_change_account_types (change_type, ancestor, NULL, aw->type);
-
-      if (!extra_change_verify (aw, change_type))
-      {
-        g_hash_table_destroy (change_type);
-        LEAVE(" ");
-        return;
-      }
-    }
-  }
-
-  gnc_finish_ok (aw, change_type);
-
-  g_hash_table_destroy (change_type);
+  gnc_finish_ok (aw, NULL);
   LEAVE(" ");
 }
 



More information about the gnucash-changes mailing list