mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-24 23:36:01 -05:00
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:
parent
cfaadc40b1
commit
6e02bdec2e
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user