mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 08:03:54 -07:00
[DeckListModel] Refactor api for offset count (#6454)
This commit is contained in:
parent
96c82a0377
commit
296866a675
4 changed files with 9 additions and 30 deletions
|
|
@ -831,11 +831,8 @@ void DeckEditorDeckDockWidget::offsetCountAtIndex(const QModelIndex &idx, bool i
|
|||
|
||||
emit requestDeckHistorySave(reason);
|
||||
|
||||
if (isIncrement) {
|
||||
deckModel->incrementAmountAtIndex(sourceIndex);
|
||||
} else {
|
||||
deckModel->decrementAmountAtIndex(sourceIndex);
|
||||
}
|
||||
int offset = isIncrement ? 1 : -1;
|
||||
deckModel->offsetCountAtIndex(sourceIndex, offset);
|
||||
|
||||
emit deckModified();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ void CardAmountWidget::decrementCardHelper(const QString &zone)
|
|||
QModelIndex idx = deckModel->findCard(rootCard.getName(), zone, rootCard.getPrinting().getUuid(),
|
||||
rootCard.getPrinting().getProperty("num"));
|
||||
|
||||
deckModel->decrementAmountAtIndex(idx);
|
||||
deckModel->offsetCountAtIndex(idx, -1);
|
||||
deckEditor->setModified(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue