This patch causes the SX "Since Last Run..." dialog to display SX variables in ASCII order, rather than ordering by hashvalue (i.e. no order at all) as was done previously.
I previously, incorrectly, sent this to the list mixed in with another patch; I'm resending it separately, as suggested on IRC, for ease of commenting. Jesse
=== modified file 'src/app-utils/gnc-sx-instance-model.c' --- src/app-utils/gnc-sx-instance-model.c 2010-01-15 20:38:33 +0000 +++ src/app-utils/gnc-sx-instance-model.c 2010-02-15 07:07:11 +0000 @@ -337,11 +337,17 @@ return rtn; } +static gint +_compare_GncSxVariables(gconstpointer a, gconstpointer b) +{ + return strcmp(((const GncSxVariable*)a)->name, ((const GncSxVariable*)b)->name); +} + static void _build_list_from_hash_elts(gpointer key, gpointer value, gpointer user_data) { GList **list = (GList**)user_data; - *list = g_list_append(*list, value); + *list = g_list_insert_sorted(*list, value, _compare_GncSxVariables); } GList *
_______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel