From ae30067f56a4a1ce5a2d6ceda3ed77a038785497 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Mon, 10 Jan 2011 20:12:39 +0000 Subject: [PATCH] Set sort order for GncEntry quickfill to LIFO by-date. Previously, the insertion order was random instead of by-date. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20051 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/gnc-entry-quickfill.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gnome-utils/gnc-entry-quickfill.c b/src/gnome-utils/gnc-entry-quickfill.c index bb568aa5f5..332b50aa6c 100644 --- a/src/gnome-utils/gnc-entry-quickfill.c +++ b/src/gnome-utils/gnc-entry-quickfill.c @@ -104,9 +104,17 @@ static void entry_cb(gpointer data, gpointer user_data) * 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; }