mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
[Refactor] Pass around LoadedDeck instead of DeckLoader (#6422)
This commit is contained in:
parent
367507e054
commit
d6db21419c
44 changed files with 253 additions and 264 deletions
|
|
@ -14,10 +14,8 @@ void EdhrecDeckApiResponse::fromJson(const QJsonArray &json)
|
|||
deckList += cardlistValue.toString() + "\n";
|
||||
}
|
||||
|
||||
deckLoader = new DeckLoader(nullptr);
|
||||
|
||||
QTextStream stream(&deckList);
|
||||
deckLoader->getDeckList()->loadFromStream_Plain(stream, true);
|
||||
deck.loadFromStream_Plain(stream, true);
|
||||
}
|
||||
|
||||
void EdhrecDeckApiResponse::debugPrint() const
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public:
|
|||
// Debug method for logging
|
||||
void debugPrint() const;
|
||||
|
||||
DeckLoader *deckLoader;
|
||||
DeckList deck;
|
||||
};
|
||||
|
||||
#endif // EDHREC_DECK_API_RESPONSE_H
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ void TabEdhRecMain::processAverageDeckResponse(QJsonObject reply)
|
|||
{
|
||||
EdhrecAverageDeckApiResponse deckData;
|
||||
deckData.fromJson(reply);
|
||||
tabSupervisor->openDeckInNewTab(deckData.deck.deckLoader);
|
||||
tabSupervisor->openDeckInNewTab({deckData.deck.deck, {}});
|
||||
}
|
||||
|
||||
void TabEdhRecMain::prettyPrintJson(const QJsonValue &value, int indentLevel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue