r15392 - gnucash/trunk/src/import-export/qif-import - Correctly empty date format combobox in qif import druid. Fix #396668.

Andreas Köhler andi5 at cvs.gnucash.org
Tue Jan 16 14:43:45 EST 2007


Author: andi5
Date: 2007-01-16 14:43:42 -0500 (Tue, 16 Jan 2007)
New Revision: 15392
Trac: http://svn.gnucash.org/trac/changeset/15392

Modified:
   gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
Log:
Correctly empty date format combobox in qif import druid. Fix #396668.

When entering the page about choosing the date format (d-m-y, etc.) the
list of entries of the combobox is to be cleared and refilled.
Therefore, loop through all entries instead of
gtk_combo_box_remove_text'ing only the first entry. Trunk-only bug.


Modified: gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/druid-qif-import.c	2007-01-15 20:28:01 UTC (rev 15391)
+++ gnucash/trunk/src/import-export/qif-import/druid-qif-import.c	2007-01-16 19:43:42 UTC (rev 15392)
@@ -566,8 +566,15 @@
        */
       if(SCM_LISTP(parse_return) && 
          (SCM_CAR(parse_return) == SCM_BOOL_T)) {
+	gint n_items;
 
-	gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
+	/* clear the combo box */
+	gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), -1);
+	n_items = gtk_tree_model_iter_n_children(
+	  gtk_combo_box_get_model(GTK_COMBO_BOX(wind->date_format_combo)), NULL);
+	while (n_items-- > 0)
+	  gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
+
 	if ((date_formats = scm_call_2(qif_file_parse_results,
 				       SCM_CDR(parse_return),
 				       scm_str2symbol("date"))) != SCM_BOOL_F) {



More information about the gnucash-changes mailing list