mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 03:28:49 -07: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
2 changed files with 5 additions and 1 deletions
|
|
@ -174,6 +174,10 @@ void CardDatabaseDisplayModel::fetchMore(const QModelIndex &index)
|
||||||
int remainder = sourceModel()->rowCount(index) - loadedRowCount;
|
int remainder = sourceModel()->rowCount(index) - loadedRowCount;
|
||||||
int itemsToFetch = qMin(100, remainder);
|
int itemsToFetch = qMin(100, remainder);
|
||||||
|
|
||||||
|
if (itemsToFetch == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
beginInsertRows(QModelIndex(), loadedRowCount, loadedRowCount + itemsToFetch - 1);
|
beginInsertRows(QModelIndex(), loadedRowCount, loadedRowCount + itemsToFetch - 1);
|
||||||
|
|
||||||
loadedRowCount += itemsToFetch;
|
loadedRowCount += itemsToFetch;
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ QModelIndex RemoteReplayList_TreeModel::parent(const QModelIndex &ind) const
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
else {
|
else {
|
||||||
ReplayNode *replayNode = dynamic_cast<ReplayNode *>(static_cast<Node *>(ind.internalPointer()));
|
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…
Add table
Add a link
Reference in a new issue