mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[VDE] Fix right click to remove card not working (#6549)
* fix typo * fix crash
This commit is contained in:
parent
8d274c1924
commit
999733fc0f
1 changed files with 6 additions and 4 deletions
|
|
@ -201,17 +201,19 @@ QModelIndex DeckStateManager::decrementCard(const ExactCard &card, const QString
|
|||
return {};
|
||||
}
|
||||
|
||||
bool success = offsetCountAtIndex(idx, false);
|
||||
bool success = offsetCountAtIndex(idx, -1);
|
||||
|
||||
if (!success) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (idx.isValid()) {
|
||||
emit focusIndexChanged(idx, true);
|
||||
// old index is no longer safe since rows could have been removed
|
||||
QModelIndex newIdx = deckListModel->findCard(card.getName(), zoneName, providerId, collectorNumber);
|
||||
if (newIdx.isValid()) {
|
||||
emit focusIndexChanged(newIdx, true);
|
||||
}
|
||||
|
||||
return idx;
|
||||
return newIdx;
|
||||
}
|
||||
|
||||
static bool doSwapCard(DeckListModel *model,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue