gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Sat Nov 6 09:36:08 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/4f2d6c7c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7a25c12b (commit)
	from  https://github.com/Gnucash/gnucash/commit/16f5be80 (commit)



commit 4f2d6c7c1be3b55864c9407e3a1ccf8e55fd7dd5
Merge: 16f5be80f 7a25c12b9
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Nov 6 21:35:02 2021 +0800

    Merge branch 'maint-progress2' into maint #1175


commit 7a25c12b9a78ff5c1b2eeca5ace53a257e18d473
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Oct 19 23:47:15 2021 +0800

    [dialog-sx-since-last-run] don't allocate repeatedly to combine strings

diff --git a/gnucash/gnome/dialog-sx-since-last-run.c b/gnucash/gnome/dialog-sx-since-last-run.c
index 5aba06020..594cf4cb4 100644
--- a/gnucash/gnome/dialog-sx-since-last-run.c
+++ b/gnucash/gnome/dialog-sx-since-last-run.c
@@ -43,6 +43,7 @@
 #include "gnc-prefs.h"
 #include "gnc-ui.h"
 #include "gnc-ui-util.h"
+#include "gnc-glib-utils.h"
 #include "Query.h"
 #include "qof.h"
 #include "gnc-ledger-display.h"
@@ -807,22 +808,11 @@ gnc_sx_slr_tree_model_adapter_new (GncSxInstanceModel *instances)
 static void
 creation_error_dialog (GList **creation_errors)
 {
-    GList *node = *creation_errors;
     GtkWidget *dialog = NULL;
     gchar *message = NULL;
     if (*creation_errors == NULL) return;
-    for(; node != NULL; node = g_list_next (node))
-    {
-        gchar *new_msg = NULL;
-        if (message == NULL)
-            new_msg = g_strdup_printf ("%s", (gchar*)(node->data));
-        else
-            new_msg = g_strdup_printf ("%s\n%s", message, (gchar*)(node->data));
-        g_free (message);
-        message = new_msg;
-        g_free (node->data);
-    }
-    g_list_free (*creation_errors);
+    message = gnc_g_list_stringjoin (*creation_errors, "\n");
+    g_list_free_full (*creation_errors, g_free);
     creation_errors = NULL;
     dialog = gtk_message_dialog_new (NULL, 0,
                                      GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,



Summary of changes:
 gnucash/gnome/dialog-sx-since-last-run.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)



More information about the gnucash-changes mailing list