mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[DeckLoader] Extract LoadedDeck struct (#6406)
* [DeckLoader] Extract LoadedDeck struct * update usages * Move enum to separate namespace * format * format * format
This commit is contained in:
parent
d3302d521f
commit
c8b419888a
14 changed files with 143 additions and 74 deletions
|
|
@ -242,7 +242,7 @@ void TabDeckStorage::actOpenLocalDeck()
|
|||
QString filePath = localDirModel->filePath(curLeft);
|
||||
|
||||
auto deckLoader = new DeckLoader(this);
|
||||
if (!deckLoader->loadFromFile(filePath, DeckLoader::CockatriceFormat, true))
|
||||
if (!deckLoader->loadFromFile(filePath, DeckFileFormat::Cockatrice, true))
|
||||
continue;
|
||||
|
||||
emit openDeckEditor(deckLoader);
|
||||
|
|
@ -308,7 +308,7 @@ void TabDeckStorage::uploadDeck(const QString &filePath, const QString &targetPa
|
|||
QFileInfo deckFileInfo(deckFile);
|
||||
|
||||
DeckLoader deck(this);
|
||||
if (!deck.loadFromFile(filePath, DeckLoader::CockatriceFormat)) {
|
||||
if (!deck.loadFromFile(filePath, DeckFileFormat::Cockatrice)) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Invalid deck file"));
|
||||
return;
|
||||
}
|
||||
|
|
@ -493,7 +493,7 @@ void TabDeckStorage::downloadFinished(const Response &r,
|
|||
QString filePath = extraData.toString();
|
||||
|
||||
DeckLoader deck(this, new DeckList(QString::fromStdString(resp.deck())));
|
||||
deck.saveToFile(filePath, DeckLoader::CockatriceFormat);
|
||||
deck.saveToFile(filePath, DeckFileFormat::Cockatrice);
|
||||
}
|
||||
|
||||
void TabDeckStorage::actNewFolder()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue