gnucash maint: QIF Import crashes when closing via the 'X' button on the last page
Geert Janssens
gjanssens at code.gnucash.org
Wed Nov 12 05:56:21 EST 2014
Updated via https://github.com/Gnucash/gnucash/commit/3a825c92 (commit)
from https://github.com/Gnucash/gnucash/commit/5f3f9a52 (commit)
commit 3a825c929f789b0c988aec8f16eab2b840ca90f0
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Wed Nov 12 12:07:51 2014 +0100
QIF Import crashes when closing via the 'X' button on the last page
Using the 'Close' button works correctly. The difference is that
the 'X' button triggers a cancel action while the 'Close' button
triggers a close action. I have changed this such that when the
import already happened (that is when the user is looking at the
summary page), a close action will be triggered in both cases.
diff --git a/src/import-export/qif-imp/assistant-qif-import.c b/src/import-export/qif-imp/assistant-qif-import.c
index 983e7ca..83b62bb 100644
--- a/src/import-export/qif-imp/assistant-qif-import.c
+++ b/src/import-export/qif-imp/assistant-qif-import.c
@@ -1309,8 +1309,17 @@ void
gnc_ui_qif_import_cancel_cb(GtkAssistant *gtkassistant, gpointer user_data)
{
QIFImportWindow *wind = user_data;
+ gint currentpage = gtk_assistant_get_current_page(gtkassistant);
+ GtkWidget *mypage = gtk_assistant_get_nth_page (gtkassistant, currentpage);
+ const char *pagename = gtk_buildable_get_name(GTK_BUILDABLE(mypage));
- if (wind->busy)
+ if (!g_strcmp0 (pagename, "summary_page"))
+ {
+ /* Hitting the window close button on the summary page should not
+ invoke a cancel action. The import has finised at that point. */
+ gnc_ui_qif_import_close_cb(gtkassistant, user_data);
+ }
+ else if (wind->busy)
{
/* Cancel any long-running Scheme operation. */
scm_c_eval_string("(qif-import:cancel)");
Summary of changes:
src/import-export/qif-imp/assistant-qif-import.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list