mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 17:45:09 -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
|
|
@ -24,11 +24,11 @@ TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor)
|
|||
|
||||
void TabDeckStorageVisual::actOpenLocalDeck(const QString &filePath)
|
||||
{
|
||||
auto deckLoader = new DeckLoader(this);
|
||||
if (!deckLoader->loadFromFile(filePath, DeckFileFormat::getFormatFromName(filePath), true)) {
|
||||
auto deckLoader = DeckLoader(this);
|
||||
if (!deckLoader.loadFromFile(filePath, DeckFileFormat::getFormatFromName(filePath), true)) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not open deck at %1").arg(filePath));
|
||||
return;
|
||||
}
|
||||
|
||||
emit openDeckEditor(deckLoader);
|
||||
emit openDeckEditor(deckLoader.getDeck());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
#include "../tab.h"
|
||||
|
||||
struct LoadedDeck;
|
||||
class AbstractClient;
|
||||
class CommandContainer;
|
||||
class DeckLoader;
|
||||
class DeckPreviewWidget;
|
||||
class QFileSystemModel;
|
||||
class QGroupBox;
|
||||
|
|
@ -39,7 +39,7 @@ public slots:
|
|||
void actOpenLocalDeck(const QString &filePath);
|
||||
|
||||
signals:
|
||||
void openDeckEditor(DeckLoader *deckLoader);
|
||||
void openDeckEditor(const LoadedDeck &deck);
|
||||
|
||||
private:
|
||||
VisualDeckStorageWidget *visualDeckStorageWidget;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue