From 2fcb02caddd447a83486c2e966c5b706b64dd4b9 Mon Sep 17 00:00:00 2001 From: David Szabo Date: Tue, 3 Apr 2018 05:04:52 +0200 Subject: [PATCH] untranslated string comparison fixed (#3164) --- cockatrice/src/decklistmodel.cpp | 5 ++++- cockatrice/src/tab_deck_editor.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/decklistmodel.cpp b/cockatrice/src/decklistmodel.cpp index 6e3228f7..e8b4b95f 100644 --- a/cockatrice/src/decklistmodel.cpp +++ b/cockatrice/src/decklistmodel.cpp @@ -106,7 +106,10 @@ QVariant DeckListModel::data(const QModelIndex &index, int role) const case 0: return node->recursiveCount(true); case 1: - return node->getVisibleName(); + if (role == Qt::DisplayRole) + return node->getVisibleName(); + else + return node->getName(); default: return QVariant(); } diff --git a/cockatrice/src/tab_deck_editor.cpp b/cockatrice/src/tab_deck_editor.cpp index 6592a1d1..bf199d85 100644 --- a/cockatrice/src/tab_deck_editor.cpp +++ b/cockatrice/src/tab_deck_editor.cpp @@ -962,9 +962,9 @@ void TabDeckEditor::actSwapCard() if (!gparent.isValid()) return; - const QString zoneName = gparent.sibling(gparent.row(), 1).data().toString(); + const QString zoneName = gparent.sibling(gparent.row(), 1).data(Qt::EditRole).toString(); actDecrement(); - const QString otherZoneName = zoneName == "Maindeck" ? DECK_ZONE_SIDE : DECK_ZONE_MAIN; + const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN; // Third argument (true) says create the card no mater what, even if not in DB QModelIndex newCardIndex = deckModel->addCard(cardName, otherZoneName, true);