mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
remove debug
This commit is contained in:
parent
c62fb85271
commit
0f67fe1c6b
1 changed files with 4 additions and 9 deletions
|
|
@ -572,16 +572,14 @@ void DeckEditorDeckDockWidget::changeSelectedCard(int changeBy)
|
|||
auto deckViewCurrentIndex = deckView->currentIndex();
|
||||
|
||||
// For some reason, if the deckModel is modified but the view is not manually reselected,
|
||||
// currentIndex will return an index for the underlying deckModel instead of the proxy,
|
||||
// which won't behave as expected when indexBelow/indexAbove crosses a header node.
|
||||
if (deckViewCurrentIndex.model() == deckModel) {
|
||||
// currentIndex will return an index for the underlying deckModel instead of the proxy.
|
||||
// That index will return an invalid index when indexBelow/indexAbove crosses a header node,
|
||||
// causing the selection to fail to move down.
|
||||
if (deckViewCurrentIndex.model() == proxy->sourceModel()) {
|
||||
deckViewCurrentIndex = proxy->mapFromSource(deckViewCurrentIndex);
|
||||
}
|
||||
|
||||
auto nextIndex = deckViewCurrentIndex.siblingAtRow(deckViewCurrentIndex.row() + changeBy);
|
||||
|
||||
qInfo() << "TRACK current:" << deckViewCurrentIndex << "next:" << nextIndex;
|
||||
|
||||
if (!nextIndex.isValid()) {
|
||||
nextIndex = deckViewCurrentIndex;
|
||||
|
||||
|
|
@ -593,9 +591,6 @@ void DeckEditorDeckDockWidget::changeSelectedCard(int changeBy)
|
|||
} else {
|
||||
nextIndex = deckView->indexAbove(nextIndex);
|
||||
}
|
||||
|
||||
qInfo() << "TRACK nextIndex:" << nextIndex;
|
||||
|
||||
node = static_cast<AbstractDecklistNode *>(nextIndex.internalPointer());
|
||||
} while (node && node->isDeckHeader());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue