1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-18 18:40:06 +00:00

Fix the sorting of Info tables when new row are added

This commit is contained in:
Stanislav Bas 2015-06-20 12:43:53 +03:00
parent f1a38ffe93
commit ced4e237a8

View File

@ -43,6 +43,12 @@ bool CSMWorld::InfoTableProxyModel::lessThan(const QModelIndex &left, const QMod
{
QModelIndex first = mSourceModel->index(getFirstInfoRow(left.row()), left.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);
}