mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-25 18:24:36 -05:00
[VDE] Fix right click to remove card not working (#6549)
* fix typo * fix crash
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user