some token code

This commit is contained in:
Max-Wilhelm Bruker 2012-04-05 11:48:13 +02:00
parent 1cd63375ba
commit f553fd7456
15 changed files with 99 additions and 21 deletions

View file

@ -437,13 +437,17 @@ void WndDeckEditor::recursiveExpand(const QModelIndex &index)
deckView->expand(index);
}
void WndDeckEditor::addCardHelper(const QString &zoneName)
void WndDeckEditor::addCardHelper(QString zoneName)
{
const QModelIndex currentIndex = databaseView->selectionModel()->currentIndex();
if (!currentIndex.isValid())
return;
const QString cardName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
CardInfo *info = db->getCard(cardName);
if (info->getIsToken())
zoneName = "tokens";
QModelIndex newCardIndex = deckModel->addCard(cardName, zoneName);
recursiveExpand(newCardIndex);
deckView->setCurrentIndex(newCardIndex);