mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-23 09:26:27 -06:00
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:
parent
6f5756c178
commit
c3f2b14470
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user