From ccf46258e5c4f3fcddf192020430e1784b71ce11 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sat, 20 Feb 2010 00:25:31 +0000 Subject: [PATCH] Display the SX variables in the "Since Last Run..." dialog in ASCII order rather than ordering by hashvalue (i.e. no order at all) as was done previously. Patch by Jesse Weinstein. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18693 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/app-utils/gnc-sx-instance-model.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app-utils/gnc-sx-instance-model.c b/src/app-utils/gnc-sx-instance-model.c index 6cfe420b33..6a24801897 100644 --- a/src/app-utils/gnc-sx-instance-model.c +++ b/src/app-utils/gnc-sx-instance-model.c @@ -337,11 +337,17 @@ gnc_sx_instance_new(GncSxInstances *parent, GncSxInstanceState state, GDate *dat 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 *