r20051 - gnucash/trunk/src/gnome-utils - Set sort order for GncEntry quickfill to LIFO by-date.

Christian Stimming cstim at code.gnucash.org
Mon Jan 10 15:12:39 EST 2011


Author: cstim
Date: 2011-01-10 15:12:39 -0500 (Mon, 10 Jan 2011)
New Revision: 20051
Trac: http://svn.gnucash.org/trac/changeset/20051

Modified:
   gnucash/trunk/src/gnome-utils/gnc-entry-quickfill.c
Log:
Set sort order for GncEntry quickfill to LIFO by-date.

Previously, the insertion order was random instead of by-date.

Modified: gnucash/trunk/src/gnome-utils/gnc-entry-quickfill.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-entry-quickfill.c	2011-01-10 14:20:53 UTC (rev 20050)
+++ gnucash/trunk/src/gnome-utils/gnc-entry-quickfill.c	2011-01-10 20:12:39 UTC (rev 20051)
@@ -104,9 +104,17 @@
  * current book. */
 static QofQuery *new_query_for_entrys(QofBook *book)
 {
+    GSList *primary_sort_params = NULL;
     QofQuery *query = qof_query_create_for (GNC_ID_ENTRY);
     g_assert(book);
     qof_query_set_book (query, book);
+
+    /* Set the sort order: By DATE_ENTERED, increasing, and returning
+     * only one single resulting item. */
+    primary_sort_params = qof_query_build_param_list(ENTRY_DATE_ENTERED, NULL);
+    qof_query_set_sort_order (query, primary_sort_params, NULL, NULL);
+    qof_query_set_sort_increasing (query, TRUE, TRUE, TRUE);
+
     return query;
 }
 



More information about the gnucash-changes mailing list