r18693 - gnucash/trunk/src/app-utils - Display the SX variables in the "Since Last Run..." dialog in ASCII order

Geert Janssens gjanssens at code.gnucash.org
Fri Feb 19 19:25:31 EST 2010


Author: gjanssens
Date: 2010-02-19 19:25:31 -0500 (Fri, 19 Feb 2010)
New Revision: 18693
Trac: http://svn.gnucash.org/trac/changeset/18693

Modified:
   gnucash/trunk/src/app-utils/gnc-sx-instance-model.c
Log:
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.

Modified: gnucash/trunk/src/app-utils/gnc-sx-instance-model.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-sx-instance-model.c	2010-02-20 00:17:41 UTC (rev 18692)
+++ gnucash/trunk/src/app-utils/gnc-sx-instance-model.c	2010-02-20 00:25:31 UTC (rev 18693)
@@ -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 *



More information about the gnucash-changes mailing list