When the user chooses another default encoding, do not recheck the file for ambiguous words, but rather just resort what has been found before.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14209 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2006-05-27 10:44:50 +00:00
parent 63dfe823fd
commit a922906362
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2006-05-27 Andreas Köhler <andi5.py@gmx.net>
* src/gnome-utils/druid-gnc-xml-import.c: When the user chooses
another default encoding, do not recheck the file for ambiguous
words, but rather just resort what has been found before.
2006-05-26 Derek Atkins <derek@ihtfp.com> 2006-05-26 Derek Atkins <derek@ihtfp.com>
* src/engine/gnc-engine.c: load the qsf backend from the right place. * src/engine/gnc-engine.c: load the qsf backend from the right place.

View File

@ -141,6 +141,7 @@ static void gxi_data_destroy (GncXmlImportData *data);
static void gxi_ambiguous_info_destroy (GncXmlImportData *data); static void gxi_ambiguous_info_destroy (GncXmlImportData *data);
static void gxi_session_destroy (GncXmlImportData *data); static void gxi_session_destroy (GncXmlImportData *data);
static void gxi_check_file (GncXmlImportData *data); static void gxi_check_file (GncXmlImportData *data);
static void gxi_sort_ambiguous_list (GncXmlImportData *data);
static gboolean gxi_parse_file (GncXmlImportData *data); static gboolean gxi_parse_file (GncXmlImportData *data);
static gboolean gxi_save_file (GncXmlImportData *data); static gboolean gxi_save_file (GncXmlImportData *data);
static void gxi_update_progress_bar (const gchar *message, double percentage); static void gxi_update_progress_bar (const gchar *message, double percentage);
@ -499,7 +500,7 @@ ambiguous_cmp (const ambiguous_type *a, const ambiguous_type *b,
} }
} else { } else {
if (string_b) { if (string_b) {
/* b looks good, a not. pub a to the top */ /* b looks good, a not. put a to the top */
return -1; return -1;
} else { } else {
/* both look suboptimal, see whether one has a decision attached to it */ /* both look suboptimal, see whether one has a decision attached to it */
@ -636,11 +637,18 @@ gxi_check_file (GncXmlImportData *data)
/* sort ambiguous words */ /* sort ambiguous words */
g_hash_table_foreach (data->ambiguous_ht, (GHFunc)ambiguous_list_insert, g_hash_table_foreach (data->ambiguous_ht, (GHFunc)ambiguous_list_insert,
data); data);
data->ambiguous_list = g_list_sort_with_data ( gxi_sort_ambiguous_list (data);
data->ambiguous_list, (GCompareDataFunc) ambiguous_cmp, data);
} }
} }
static void
gxi_sort_ambiguous_list (GncXmlImportData *data)
{
data->ambiguous_list = g_list_sort_with_data (
data->ambiguous_list, (GCompareDataFunc) ambiguous_cmp, data);
}
static void static void
subst_insert_amb (gchar *byte_sequence, GList *conv_list, GncXmlImportData *data) subst_insert_amb (gchar *byte_sequence, GList *conv_list, GncXmlImportData *data)
{ {
@ -1137,7 +1145,7 @@ gxi_default_enc_combo_changed_cb (GtkComboBox *combo, GncXmlImportData *data)
} }
data->default_encoding = curr_enc; data->default_encoding = curr_enc;
gxi_check_file (data); gxi_sort_ambiguous_list (data);
gxi_update_string_box (data); gxi_update_string_box (data);
gxi_update_conversion_forward (data); gxi_update_conversion_forward (data);
} }