gnucash maint: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Thu Nov 24 06:27:13 EST 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/59d95a4c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/80f11014 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f93da32d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1554ec6c (commit)
	from  https://github.com/Gnucash/gnucash/commit/f13cfa21 (commit)



commit 59d95a4ce6332442d57c70dab4e4bac30408f8d5
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Nov 24 11:16:01 2022 +0000

    Bug 798545 - Crash when updating document link on vendor bill
    
    There were two issues here, the first one was that the copied doclink
    was pointing to the original doclink which lead to a double-free. The
    second is the setting of the doclink on the copied invoice needs to be
    done with gncInvoiceSetDocLink otherwise on closure the doclink value
    will disappear.

diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 745012bd1..7f8f923c3 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -379,7 +379,10 @@ GncInvoice *gncInvoiceCopy (const GncInvoice *from)
     // Oops. Do not forget to copy the pointer to the correct currency here.
     invoice->currency = from->currency;
 
-    invoice->doclink = from->doclink;
+    if (from->doclink == is_unset)
+        invoice->doclink = (char*)is_unset;
+    else
+        gncInvoiceSetDocLink (invoice, from->doclink);
 
     // Copy all invoice->entries
     for (node = from->entries; node; node = node->next)

commit 80f1101447557c50b6e987b69dd6f04b7398b564
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Nov 24 10:12:29 2022 +0000

    Bug 760274 - The Statusbar "forgets" when register doesn't have focus
    
    Only update the status bar if the current page is the same as the
    register page.

diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 93eef4203..81ac39874 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -5259,6 +5259,11 @@ gnc_plugin_page_help_changed_cb (GNCSplitReg* gsr,
         return;
     }
 
+    // only update status text if on current page
+    if (GNC_IS_MAIN_WINDOW(window) && (gnc_main_window_get_current_page 
+       (GNC_MAIN_WINDOW(window)) != GNC_PLUGIN_PAGE(register_page)))
+       return;
+
     /* Get the text from the ledger */
     priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (register_page);
     reg = gnc_ledger_display_get_split_register (priv->ledger);

commit f93da32dfcb800cda8e618f48d483d6614b52d75
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Nov 24 10:02:28 2022 +0000

    Add missing gtk_tree_path_free to gnucash-item-list.c

diff --git a/gnucash/register/register-gnome/gnucash-item-list.c b/gnucash/register/register-gnome/gnucash-item-list.c
index 625b9aa67..26cf3af4b 100644
--- a/gnucash/register/register-gnome/gnucash-item-list.c
+++ b/gnucash/register/register-gnome/gnucash-item-list.c
@@ -224,7 +224,6 @@ gnc_item_list_show_selected (GncItemList* item_list)
 {
     GtkTreeSelection* selection;
     GtkTreeIter iter;
-    GtkTreePath* path;
     GtkTreeModel* model;
 
     g_return_if_fail (item_list != NULL);
@@ -234,10 +233,11 @@ gnc_item_list_show_selected (GncItemList* item_list)
 
     if (gtk_tree_selection_get_selected (selection, &model, &iter))
     {
-        path = gtk_tree_model_get_path (model, &iter);
+        GtkTreePath* path = gtk_tree_model_get_path (model, &iter);
 
         gtk_tree_view_scroll_to_cell (item_list->tree_view,
                                       path, NULL, TRUE, 0.5, 0.0);
+        gtk_tree_path_free (path);
     }
 }
 

commit 1554ec6c0f1d407b4a0968f1d68ae2a9570b7fdd
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Nov 24 10:01:43 2022 +0000

    Add missing gtk_tree_path_free to gnc-plugin-budget.c

diff --git a/gnucash/gnome/gnc-plugin-budget.c b/gnucash/gnome/gnc-plugin-budget.c
index 55848e2b9..76e7a21c4 100644
--- a/gnucash/gnome/gnc-plugin-budget.c
+++ b/gnucash/gnome/gnc-plugin-budget.c
@@ -336,7 +336,11 @@ gnc_budget_gui_select_budget (GtkWindow *parent, QofBook *book)
     bgt = gnc_budget_get_default (book);
 
     if (bgt && gnc_tree_model_budget_get_iter_for_budget (tm, &iter, bgt))
-        gtk_tree_view_set_cursor (tv, gtk_tree_model_get_path (tm, &iter), NULL, FALSE);
+    {
+        GtkTreePath *path = gtk_tree_model_get_path (tm, &iter);
+        gtk_tree_view_set_cursor (tv, path, NULL, FALSE);
+        gtk_tree_path_free (path);
+    }
 
     bgt = NULL;
     response = gtk_dialog_run (dlg);



Summary of changes:
 gnucash/gnome/gnc-plugin-budget.c                   | 6 +++++-
 gnucash/gnome/gnc-plugin-page-register.c            | 5 +++++
 gnucash/register/register-gnome/gnucash-item-list.c | 4 ++--
 libgnucash/engine/gncInvoice.c                      | 5 ++++-
 4 files changed, 16 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list