Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/widgets/itemptrvector.cpp
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 42 | if (count() > 0) { | |||
---|---|---|---|---|---|
55 | std::sort(begin(), end(), item_cmp); | 55 | std::sort(begin(), end(), item_cmp); | ||
56 | } | 56 | } | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2) | 59 | bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2) | ||
60 | { | 60 | { | ||
61 | const QList<SortField>& sortOrder = i1->getParent()->sortOrder(); | 61 | const QList<SortField>& sortOrder = i1->getParent()->sortOrder(); | ||
62 | QList<SortField>::const_iterator it; | 62 | QList<SortField>::const_iterator it; | ||
63 | int rc = 0; | 63 | auto rc = 0; | ||
64 | bool ok1, ok2; | 64 | bool ok1, ok2; | ||
65 | qulonglong n1, n2; | 65 | qulonglong n1, n2; | ||
66 | 66 | | |||
67 | for (it = sortOrder.begin(); it != sortOrder.end(); ++it) { | 67 | for (it = sortOrder.begin(); it != sortOrder.end(); ++it) { | ||
68 | SortField sortField = static_cast<SortField>(*it); | 68 | SortField sortField = static_cast<SortField>(*it); | ||
69 | switch (qAbs(static_cast<int>(sortField))) { | 69 | switch (qAbs(static_cast<int>(sortField))) { | ||
70 | case (int)SortField::PostDate: | 70 | case (int)SortField::PostDate: | ||
71 | rc = i2->sortPostDate().daysTo(i1->sortPostDate()); | 71 | rc = i2->sortPostDate().daysTo(i1->sortPostDate()); | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |