mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
A DeckLoader is not a DeckList. (#6306)
* A DeckLoader is not a DeckList. Took 2 hours 39 minutes * Explicitly initialize base class in copy constructor? Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
4c431e98a6
commit
8e88749078
32 changed files with 163 additions and 139 deletions
|
|
@ -75,12 +75,12 @@ bool AbstractDlgDeckTextEdit::loadIntoDeck(DeckLoader *deckLoader) const
|
|||
QString buffer = contentsEdit->toPlainText();
|
||||
|
||||
if (buffer.contains("<cockatrice_deck version=\"1\">")) {
|
||||
return deckLoader->loadFromString_Native(buffer);
|
||||
return deckLoader->getDeckList()->loadFromString_Native(buffer);
|
||||
}
|
||||
|
||||
QTextStream stream(&buffer);
|
||||
|
||||
if (deckLoader->loadFromStream_Plain(stream, true)) {
|
||||
if (deckLoader->getDeckList()->loadFromStream_Plain(stream, true)) {
|
||||
if (loadSetNameAndNumberCheckBox->isChecked()) {
|
||||
deckLoader->resolveSetNameAndNumberToProviderID();
|
||||
} else {
|
||||
|
|
@ -121,8 +121,7 @@ void DlgLoadDeckFromClipboard::actRefresh()
|
|||
|
||||
void DlgLoadDeckFromClipboard::actOK()
|
||||
{
|
||||
deckList = new DeckLoader;
|
||||
deckList->setParent(this);
|
||||
deckList = new DeckLoader(this);
|
||||
|
||||
if (loadIntoDeck(deckList)) {
|
||||
accept();
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ void DlgLoadDeckFromWebsite::accept()
|
|||
}
|
||||
|
||||
// Parse the plain text deck here
|
||||
DeckLoader *loader = new DeckLoader();
|
||||
DeckLoader *loader = new DeckLoader(this);
|
||||
QTextStream stream(&deckText);
|
||||
loader->loadFromStream_Plain(stream, false);
|
||||
loader->getDeckList()->loadFromStream_Plain(stream, false);
|
||||
loader->resolveSetNameAndNumberToProviderID();
|
||||
deck = loader;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue