Fix crash on replay list sorting, fix error popups on win debug (#5388)

* Fix annoying popups on start

* Fix replay list item parent index calculation #5311

---------

Co-authored-by: Jakub Mrowinski <ryder052@outlook.com>
This commit is contained in:
ryder052 2024-12-30 02:10:12 +01:00 committed by GitHub
parent cfaadc40b1
commit 6e02bdec2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -174,6 +174,10 @@ void CardDatabaseDisplayModel::fetchMore(const QModelIndex &index)
int remainder = sourceModel()->rowCount(index) - loadedRowCount;
int itemsToFetch = qMin(100, remainder);
if (itemsToFetch == 0) {
return;
}
beginInsertRows(QModelIndex(), loadedRowCount, loadedRowCount + itemsToFetch - 1);
loadedRowCount += itemsToFetch;

View File

@ -192,7 +192,7 @@ QModelIndex RemoteReplayList_TreeModel::parent(const QModelIndex &ind) const
return QModelIndex();
else {
ReplayNode *replayNode = dynamic_cast<ReplayNode *>(static_cast<Node *>(ind.internalPointer()));
return createIndex(replayNode->getParent()->indexOf(replayNode), 0, replayNode);
return createIndex(replayNode->getParent()->indexOf(replayNode), 0, replayNode->getParent());
}
}