r21256 - gnucash/trunk/src/gnc/fpo - Bug #658851: [Cutecash] Sort the dashboard from latest to earliest.

Christian Stimming cstim at code.gnucash.org
Tue Sep 13 14:49:27 EDT 2011


Author: cstim
Date: 2011-09-13 14:49:27 -0400 (Tue, 13 Sep 2011)
New Revision: 21256
Trac: http://svn.gnucash.org/trac/changeset/21256

Modified:
   gnucash/trunk/src/gnc/fpo/ViewletModel.cpp
Log:
Bug #658851: [Cutecash] Sort the dashboard from latest to earliest.

Modified: gnucash/trunk/src/gnc/fpo/ViewletModel.cpp
===================================================================
--- gnucash/trunk/src/gnc/fpo/ViewletModel.cpp	2011-09-11 14:54:07 UTC (rev 21255)
+++ gnucash/trunk/src/gnc/fpo/ViewletModel.cpp	2011-09-13 18:49:27 UTC (rev 21256)
@@ -116,6 +116,13 @@
     return Split::fromGList(splitL);
 }
 
+static bool greaterThanByDate(const ::Split* a, const ::Split* b)
+{
+    const ::Transaction* tx_a = xaccSplitGetParent(a);
+    const ::Transaction* tx_b = xaccSplitGetParent(b);
+    return xaccTransGetDate(tx_a) > xaccTransGetDate(tx_b);
+}
+
 SplitQList
 ViewletModel::buildSplitListDateSort(AccountQList accountsList)
 {
@@ -136,7 +143,7 @@
         }
     }
 
-    qSort(allSplitsList.begin(), allSplitsList.end(), &ViewletModel::lessThanByDate);
+    qSort(allSplitsList.begin(), allSplitsList.end(), &greaterThanByDate);
     return allSplitsList;
 }
 



More information about the gnucash-changes mailing list