gnucash maint: Don't overwrite gnc_window_show_progress if message is empty string

Christopher Lam clam at code.gnucash.org
Sun Sep 6 21:08:37 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/42249c89 (commit)
	from  https://github.com/Gnucash/gnucash/commit/de0422da (commit)



commit 42249c89699b38b5f35a72941cc69c9306dcf803
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Sep 7 08:47:34 2020 +0800

    Don't overwrite gnc_window_show_progress if message is empty string
    
    gnc_window_show_progress receives 2 arguments: message string and
    percentage. The progressbar text was not updated if message string was
    NULL. Reports call (gnc-window-show-progress "" percent). This commit
    ensures empty string does not overwrite progressbar text.

diff --git a/gnucash/gnome-utils/gnc-window.c b/gnucash/gnome-utils/gnc-window.c
index d84d41a98..2c9dd907b 100644
--- a/gnucash/gnome-utils/gnc-window.c
+++ b/gnucash/gnome-utils/gnc-window.c
@@ -190,7 +190,7 @@ gnc_window_show_progress (const char *message, double percentage)
     }
     else
     {
-        if (message)
+        if (message && *message)
             gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), message);
         if ((percentage == 0) &&
                 (GNC_WINDOW_GET_IFACE(window)->ui_set_sensitive != NULL))



Summary of changes:
 gnucash/gnome-utils/gnc-window.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list