Minor fixes to some std::sort calls (#3967)
This commit is contained in:
parent
1976c4caed
commit
db85ec48c7
2 changed files with 3 additions and 3 deletions
|
@ -364,7 +364,7 @@ void WndSets::actDown()
|
|||
{
|
||||
QModelIndexList rows = view->selectionModel()->selectedRows();
|
||||
// QModelIndex only implements operator<, so we can't use std::greater
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return !(b < a); });
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return b < a; });
|
||||
QSet<int> newRows;
|
||||
|
||||
if (rows.empty())
|
||||
|
@ -412,7 +412,7 @@ void WndSets::actBottom()
|
|||
{
|
||||
QModelIndexList rows = view->selectionModel()->selectedRows();
|
||||
// QModelIndex only implements operator<, so we can't use std::greater
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return !(b < a); });
|
||||
std::sort(rows.begin(), rows.end(), [](const QModelIndex &a, const QModelIndex &b) { return b < a; });
|
||||
QSet<int> newRows;
|
||||
int newRow = model->rowCount() - 1;
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ public:
|
|||
}
|
||||
inline bool operator()(QPair<int, AbstractDecklistNode *> a, QPair<int, AbstractDecklistNode *> b) const
|
||||
{
|
||||
return (order == Qt::AscendingOrder) ^ (a.second->compare(b.second));
|
||||
return (order == Qt::AscendingOrder) ? (b.second->compare(a.second)) : (a.second->compare(b.second));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue