forked from mirror/openmw-tes3mp
Fix the sorting of Info tables when new row are added
This commit is contained in:
parent
f1a38ffe93
commit
ced4e237a8
1 changed files with 6 additions and 0 deletions
|
@ -43,6 +43,12 @@ bool CSMWorld::InfoTableProxyModel::lessThan(const QModelIndex &left, const QMod
|
||||||
{
|
{
|
||||||
QModelIndex first = mSourceModel->index(getFirstInfoRow(left.row()), left.column());
|
QModelIndex first = mSourceModel->index(getFirstInfoRow(left.row()), left.column());
|
||||||
QModelIndex second = mSourceModel->index(getFirstInfoRow(right.row()), right.column());
|
QModelIndex second = mSourceModel->index(getFirstInfoRow(right.row()), right.column());
|
||||||
|
|
||||||
|
// If both indexes are belonged to the same Topic/Journal, compare their original rows only
|
||||||
|
if (first.row() == second.row())
|
||||||
|
{
|
||||||
|
return sortOrder() == Qt::AscendingOrder ? left.row() < right.row() : right.row() < left.row();
|
||||||
|
}
|
||||||
return IdTableProxyModel::lessThan(first, second);
|
return IdTableProxyModel::lessThan(first, second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue