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.
This commit is contained in:
Christopher Lam 2020-09-07 08:47:34 +08:00
parent de0422da25
commit 42249c8969

View File

@ -190,7 +190,7 @@ gnc_window_show_progress (const char *message, double percentage)
} }
else else
{ {
if (message) if (message && *message)
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), message); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), message);
if ((percentage == 0) && if ((percentage == 0) &&
(GNC_WINDOW_GET_IFACE(window)->ui_set_sensitive != NULL)) (GNC_WINDOW_GET_IFACE(window)->ui_set_sensitive != NULL))