Bug #658851: [Cutecash] Sort the dashboard from latest to earliest.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21256 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-09-13 18:49:27 +00:00
parent 6f5756c178
commit c3f2b14470

View File

@ -116,6 +116,13 @@ ViewletModel::buildSplitListDateSort(::Account *selectedAccount)
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 @@ ViewletModel::buildSplitListDateSort(AccountQList accountsList)
}
}
qSort(allSplitsList.begin(), allSplitsList.end(), &ViewletModel::lessThanByDate);
qSort(allSplitsList.begin(), allSplitsList.end(), &greaterThanByDate);
return allSplitsList;
}