mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
[DeckList] Refactor load from plaintext to take normalizer as param (#6664)
* [DeckList] Refactor load from plaintext to take normalizer as param * update usages * weaken unit test * weaken unit test more * revert unit test * move CardNameNormalizer to libcockatrice_card * update unit test * formatting
This commit is contained in:
parent
bd5cbb89d4
commit
dead993639
14 changed files with 94 additions and 52 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QTextStream>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/card/import/card_name_normalizer.h>
|
||||
|
||||
/**
|
||||
* Creates the main layout and connects the signals that are common to all versions of this window
|
||||
|
|
@ -81,7 +82,7 @@ bool AbstractDlgDeckTextEdit::loadIntoDeck(DeckList &deckList) const
|
|||
|
||||
QTextStream stream(&buffer);
|
||||
|
||||
if (deckList.loadFromStream_Plain(stream, true)) {
|
||||
if (deckList.loadFromStream_Plain(stream, true, CardNameNormalizer())) {
|
||||
if (loadSetNameAndNumberCheckBox->isChecked()) {
|
||||
deckList.forEachCard(CardNodeFunction::ResolveProviderId());
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <QJsonObject>
|
||||
#include <QMessageBox>
|
||||
#include <QNetworkReply>
|
||||
#include <libcockatrice/card/import/card_name_normalizer.h>
|
||||
#include <version_string.h>
|
||||
|
||||
DlgLoadDeckFromWebsite::DlgLoadDeckFromWebsite(QWidget *parent) : QDialog(parent)
|
||||
|
|
@ -99,7 +100,7 @@ void DlgLoadDeckFromWebsite::accept()
|
|||
// Parse the plain text deck here
|
||||
DeckList deckList;
|
||||
QTextStream stream(&deckText);
|
||||
deckList.loadFromStream_Plain(stream, false);
|
||||
deckList.loadFromStream_Plain(stream, false, CardNameNormalizer());
|
||||
deckList.forEachCard(CardNodeFunction::ResolveProviderId());
|
||||
deck = deckList;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <QDialog>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QLoggingCategory>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue