gnucash maint: Multiple changes pushed
Robert Fewell
bobit at code.gnucash.org
Sun May 3 06:54:07 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/2fae14c3 (commit)
via https://github.com/Gnucash/gnucash/commit/f1c2e339 (commit)
via https://github.com/Gnucash/gnucash/commit/327544e6 (commit)
via https://github.com/Gnucash/gnucash/commit/47594533 (commit)
from https://github.com/Gnucash/gnucash/commit/5ed6b424 (commit)
commit 2fae14c3baf90fe0b71d15b9ad34a5d9edd408c9
Merge: 5ed6b424d f1c2e339f
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun May 3 11:52:07 2020 +0100
Merge Chris Good's branch 'bug797648Rec-2', PR #713 into maint
commit f1c2e339fc9bf7df3487057fbe6fc06d872ac1a9
Author: goodvibes2 <goodchris96 at gmail.com>
Date: Sat May 2 16:43:49 2020 +1000
Bug 797648 Redo - Reconciliation - Treat each split independently
The previous change under this bug which propagated the status
change (reconcile or unreconcile) of any split for the account to
be reconciled (and its subaccounts) in a transaction, to all
splits for the account to be reconciled (and its subaccounts) in
the transaction, is incorrect. Each split needs to be able to be
checked or unchecked independently of any other split in the
transaction.
diff --git a/gnucash/gnome/reconcile-view.c b/gnucash/gnome/reconcile-view.c
index 7815e32ab..165e78456 100644
--- a/gnucash/gnome/reconcile-view.c
+++ b/gnucash/gnome/reconcile-view.c
@@ -518,94 +518,14 @@ gnc_reconcile_view_toggle_split (GNCReconcileView *view, Split *split)
}
-static void
-gnc_reconcile_view_toggle_children (Account *account, GNCReconcileView *view, Split *split)
-{
- GList *child_accounts, *node;
- Transaction *transaction;
-
- /*
- * Need to get all splits in this transaction and identify any that are
- * in the same hierarchy as the account being reconciled (not necessarily
- * the account this split is from.)
- *
- * For each of these splits toggle them all to the same state.
- */
- child_accounts = gnc_account_get_descendants (account);
- child_accounts = g_list_prepend (child_accounts, account);
- transaction = xaccSplitGetParent (split);
- for (node = xaccTransGetSplitList (transaction); node; node = node->next)
- {
- Split *other_split;
- Account *other_account;
- GNCReconcileView *current_view;
-
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid;
- gpointer pointer;
-
- other_split = node->data;
- other_account = xaccSplitGetAccount (other_split);
- if (other_split == split)
- continue;
- /* Check this 'other' account is in the same hierarchy */
- if (!g_list_find (child_accounts, other_account))
- continue;
- /* Search our sibling view for this split first. We search the
- * sibling list first because that it where it is most likely to be.
- */
- current_view = view->sibling;
- if (!gnc_query_view_item_in_view (GNC_QUERY_VIEW (current_view), other_split))
- {
- /* Not in the sibling view, try this view */
- current_view = view;
- if (!gnc_query_view_item_in_view (GNC_QUERY_VIEW (current_view), other_split))
- /* We can't find it, nothing more I can do about it */
- continue;
- }
-
- /* Found the other split. Toggle the reconciled check mark in the view... */
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (current_view));
- valid = gtk_tree_model_get_iter_first (model, &iter);
-
- while (valid)
- {
- // Walk through the list, reading each row
- gtk_tree_model_get (model, &iter, REC_POINTER, &pointer, -1);
-
- if(pointer == other_split)
- {
- gboolean toggled;
- gtk_tree_model_get (model, &iter, REC_RECN, &toggled, -1);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter, REC_RECN, !toggled, -1);
- break;
- }
-
- valid = gtk_tree_model_iter_next (model, &iter);
- }
-
- /* ...and toggle its reconciled state in the internal hash */
- gnc_reconcile_view_toggle_split (current_view, other_split);
- }
- g_list_free (child_accounts);
-}
-
-
static void
gnc_reconcile_view_toggle (GNCReconcileView *view, Split *split)
{
- gboolean include_children;
-
g_return_if_fail (GNC_IS_RECONCILE_VIEW (view));
g_return_if_fail (view->reconciled != NULL);
gnc_reconcile_view_toggle_split (view, split);
- include_children = xaccAccountGetReconcileChildrenStatus (view->account);
- if (include_children)
- gnc_reconcile_view_toggle_children (view->account, view, split);
-
g_signal_emit (G_OBJECT (view),
reconcile_view_signals[TOGGLE_RECONCILED], 0, split);
}
commit 327544e6c048057f2675b223fd2679e688e0a063
Author: goodvibes2 <goodchris96 at gmail.com>
Date: Sat May 2 16:11:50 2020 +1000
Revert "Bug 797648 - Fix problem reconciling multiple splits in a transaction"
This reverts commit dd589060a3580456d5dfd079e7f0f75cc7252a9b.
diff --git a/gnucash/gnome/reconcile-view.c b/gnucash/gnome/reconcile-view.c
index 6f406befb..7815e32ab 100644
--- a/gnucash/gnome/reconcile-view.c
+++ b/gnucash/gnome/reconcile-view.c
@@ -501,43 +501,8 @@ gnc_reconcile_view_class_init (GNCReconcileViewClass *klass)
}
-static gboolean
-gnc_reconcile_view_toggle_split (GNCReconcileView *view, Split *split)
-{
- Split *current;
-
- g_return_val_if_fail (GNC_IS_RECONCILE_VIEW (view), FALSE);
- g_return_val_if_fail (view->reconciled != NULL, FALSE);
-
- current = g_hash_table_lookup (view->reconciled, split);
-
- if (current == NULL)
- {
- g_hash_table_insert (view->reconciled, split, split);
- return TRUE;
- }
- else
- {
- g_hash_table_remove (view->reconciled, split);
- return FALSE;
- }
-}
-
-
-/*****************************************************************************\
- * gnc_reconcile_view_rec_or_unrec_split *
- * insert or remove a child split from the list of splits to be reconciled *
- * (view->reconciled) so that all other splits in the same transaction *
- * for the account being reconciled (including children), are the same *
- * reconciliation state as the split that has been toggled *
- * *
- * Args: view - the view to use *
- * split - the split to be inserted or removed *
- * reconcile - TRUE=insert, FALSE=remove *
- * Returns: void *
-\*****************************************************************************/
static void
-gnc_reconcile_view_rec_or_unrec_split (GNCReconcileView *view, Split *split, gboolean reconcile)
+gnc_reconcile_view_toggle_split (GNCReconcileView *view, Split *split)
{
Split *current;
@@ -546,15 +511,15 @@ gnc_reconcile_view_rec_or_unrec_split (GNCReconcileView *view, Split *split, gbo
current = g_hash_table_lookup (view->reconciled, split);
- if (current == NULL && reconcile)
+ if (current == NULL)
g_hash_table_insert (view->reconciled, split, split);
- if ((current != NULL) && (!reconcile))
+ else
g_hash_table_remove (view->reconciled, split);
}
static void
-gnc_reconcile_view_toggle_children (Account *account, GNCReconcileView *view, Split *split, gboolean reconcile)
+gnc_reconcile_view_toggle_children (Account *account, GNCReconcileView *view, Split *split)
{
GList *child_accounts, *node;
Transaction *transaction;
@@ -564,8 +529,7 @@ gnc_reconcile_view_toggle_children (Account *account, GNCReconcileView *view, Sp
* in the same hierarchy as the account being reconciled (not necessarily
* the account this split is from.)
*
- * For each of these splits set them to the same state as the split whose
- * checkbox was toggled.
+ * For each of these splits toggle them all to the same state.
*/
child_accounts = gnc_account_get_descendants (account);
child_accounts = g_list_prepend (child_accounts, account);
@@ -614,8 +578,7 @@ gnc_reconcile_view_toggle_children (Account *account, GNCReconcileView *view, Sp
{
gboolean toggled;
gtk_tree_model_get (model, &iter, REC_RECN, &toggled, -1);
- if (toggled != reconcile)
- gtk_list_store_set (GTK_LIST_STORE (model), &iter, REC_RECN, reconcile, -1);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter, REC_RECN, !toggled, -1);
break;
}
@@ -623,7 +586,7 @@ gnc_reconcile_view_toggle_children (Account *account, GNCReconcileView *view, Sp
}
/* ...and toggle its reconciled state in the internal hash */
- gnc_reconcile_view_rec_or_unrec_split (current_view, other_split, reconcile);
+ gnc_reconcile_view_toggle_split (current_view, other_split);
}
g_list_free (child_accounts);
}
@@ -633,16 +596,15 @@ static void
gnc_reconcile_view_toggle (GNCReconcileView *view, Split *split)
{
gboolean include_children;
- gboolean is_reconciled;
g_return_if_fail (GNC_IS_RECONCILE_VIEW (view));
g_return_if_fail (view->reconciled != NULL);
- is_reconciled = gnc_reconcile_view_toggle_split (view, split);
+ gnc_reconcile_view_toggle_split (view, split);
include_children = xaccAccountGetReconcileChildrenStatus (view->account);
if (include_children)
- gnc_reconcile_view_toggle_children (view->account, view, split, is_reconciled);
+ gnc_reconcile_view_toggle_children (view->account, view, split);
g_signal_emit (G_OBJECT (view),
reconcile_view_signals[TOGGLE_RECONCILED], 0, split);
commit 4759453356cfa0590b2f117aeb266bca8675bbbe
Author: goodvibes2 <goodchris96 at gmail.com>
Date: Sat May 2 16:10:19 2020 +1000
Revert "Use Doxygen format for function comment"
This reverts commit d2986559de203471ecd2280eb1a61afb0b5c6934.
diff --git a/gnucash/gnome/reconcile-view.c b/gnucash/gnome/reconcile-view.c
index d600bca9c..6f406befb 100644
--- a/gnucash/gnome/reconcile-view.c
+++ b/gnucash/gnome/reconcile-view.c
@@ -524,17 +524,18 @@ gnc_reconcile_view_toggle_split (GNCReconcileView *view, Split *split)
}
-/** Insert or remove a split from the list of splits to be reconciled
- * (view->reconciled) so that all other splits in the same transaction
- * for the account being reconciled (including children), are the same
- * reconciliation state as the split that has been toggled.
- *
- * @param view The view to use.
- *
- * @param split The split to be inserted or removed
- *
- * @param reconcile TRUE=insert, FALSE=remove
- */
+/*****************************************************************************\
+ * gnc_reconcile_view_rec_or_unrec_split *
+ * insert or remove a child split from the list of splits to be reconciled *
+ * (view->reconciled) so that all other splits in the same transaction *
+ * for the account being reconciled (including children), are the same *
+ * reconciliation state as the split that has been toggled *
+ * *
+ * Args: view - the view to use *
+ * split - the split to be inserted or removed *
+ * reconcile - TRUE=insert, FALSE=remove *
+ * Returns: void *
+\*****************************************************************************/
static void
gnc_reconcile_view_rec_or_unrec_split (GNCReconcileView *view, Split *split, gboolean reconcile)
{
Summary of changes:
gnucash/gnome/reconcile-view.c | 125 ++---------------------------------------
1 file changed, 4 insertions(+), 121 deletions(-)
More information about the gnucash-changes
mailing list