mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23:57 -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
|
|
@ -90,14 +90,14 @@ void ArchidektApiResponseDeckDisplayWidget::onGroupCriteriaChange(const QString
|
|||
|
||||
void ArchidektApiResponseDeckDisplayWidget::actOpenInDeckEditor()
|
||||
{
|
||||
auto loader = new DeckLoader(this);
|
||||
loader->getDeckList()->loadFromString_Native(model->getDeckList()->writeToString_Native());
|
||||
|
||||
loader->getDeckList()->setName(response.getDeckName());
|
||||
loader->getDeckList()->setGameFormat(
|
||||
DeckList deckList(*model->getDeckList());
|
||||
deckList.setName(response.getDeckName());
|
||||
deckList.setGameFormat(
|
||||
ArchidektFormats::formatToCockatriceName(ArchidektFormats::DeckFormat(response.getDeckFormat() - 1)));
|
||||
|
||||
emit openInDeckEditor(loader);
|
||||
LoadedDeck loadedDeck = {deckList, {}};
|
||||
|
||||
emit openInDeckEditor(loadedDeck);
|
||||
}
|
||||
|
||||
void ArchidektApiResponseDeckDisplayWidget::clearAllDisplayWidgets()
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
*
|
||||
* ### Signals
|
||||
* - `requestNavigation(QString url)` — triggered when navigation to a deck URL is requested.
|
||||
* - `openInDeckEditor(DeckLoader *loader)` — emitted when the user chooses to open the deck
|
||||
* - `openInDeckEditor(const LoadedDeck &deck)` — emitted when the user chooses to open the deck
|
||||
* in the deck editor.
|
||||
*
|
||||
* ### Features
|
||||
|
|
@ -52,9 +52,9 @@ signals:
|
|||
|
||||
/**
|
||||
* @brief Emitted when the deck should be opened in the deck editor.
|
||||
* @param loader Initialized DeckLoader containing the deck data.
|
||||
* @param deck LoadedDeck containing the deck data.
|
||||
*/
|
||||
void openInDeckEditor(DeckLoader *loader);
|
||||
void openInDeckEditor(const LoadedDeck &deck);
|
||||
|
||||
public:
|
||||
/**
|
||||
|
|
@ -75,7 +75,7 @@ public:
|
|||
void retranslateUi();
|
||||
|
||||
/**
|
||||
* @brief Opens the deck in the deck editor via DeckLoader.
|
||||
* @brief Opens the deck in the deck editor.
|
||||
*/
|
||||
void actOpenInDeckEditor();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue