mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 19:18:55 -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 {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success = offsetCountAtIndex(idx, false);
|
bool success = offsetCountAtIndex(idx, -1);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx.isValid()) {
|
// old index is no longer safe since rows could have been removed
|
||||||
emit focusIndexChanged(idx, true);
|
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,
|
static bool doSwapCard(DeckListModel *model,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue