gnucash maint: Bug 796638 - configuration not properly saved for CSV transactions import form
Geert Janssens
gjanssens at code.gnucash.org
Thu Jun 21 05:36:58 EDT 2018
Updated via https://github.com/Gnucash/gnucash/commit/4485966b (commit)
from https://github.com/Gnucash/gnucash/commit/a2983935 (commit)
commit 4485966becbce68a0f94eb25a4c054bd3528a2c4
Author: Geert Janssens <geert at kobaltwit.be>
Date: Thu Jun 21 11:36:45 2018 +0200
Bug 796638 - configuration not properly saved for CSV transactions import form
diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
index 80a871c..b7369d7 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
+++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
@@ -1614,21 +1614,30 @@ void CsvImpTransAssist::preview_refresh_table ()
void
CsvImpTransAssist::preview_refresh ()
{
+ // Cache skip settings. Updating the widgets one by one
+ // triggers a callback the transfers all skip widgets'
+ // values to settings. So by the time the next widget value
+ // is to be set, that widget's 'new' setting has already been replaced by
+ // its old setting preventing us from using it here sensibly.
+ // Another solution might have been to delay callbacks from running
+ // until after all values are set.
+ auto skip_start_lines = tx_imp->skip_start_lines();
+ auto skip_end_lines = tx_imp->skip_end_lines();
+ auto skip_alt_lines = tx_imp->skip_alt_lines();
+
// Set start row
auto adj = gtk_spin_button_get_adjustment (start_row_spin);
gtk_adjustment_set_upper (adj, tx_imp->m_parsed_lines.size());
- gtk_spin_button_set_value (start_row_spin,
- tx_imp->skip_start_lines());
+ gtk_spin_button_set_value (start_row_spin, skip_start_lines);
// Set end row
adj = gtk_spin_button_get_adjustment (end_row_spin);
gtk_adjustment_set_upper (adj, tx_imp->m_parsed_lines.size());
- gtk_spin_button_set_value (end_row_spin,
- tx_imp->skip_end_lines());
+ gtk_spin_button_set_value (end_row_spin, skip_end_lines);
// Set Alternate rows
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(skip_alt_rows_button),
- tx_imp->skip_alt_lines());
+ skip_alt_lines);
// Set multi-split indicator
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(multi_split_cbutton),
Summary of changes:
.../csv-imp/assistant-csv-trans-import.cpp | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
More information about the gnucash-changes
mailing list