[DeckLoader] Make save/load methods static (#6476)

* const

* [DeckLoader] make methods static

* use static methods

* add docs

* add docs
This commit is contained in:
RickyRister 2026-01-16 10:20:36 -08:00 committed by GitHub
parent c7c7bf550a
commit d579c82cb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 209 additions and 166 deletions

View file

@ -24,11 +24,12 @@ TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor)
void TabDeckStorageVisual::actOpenLocalDeck(const QString &filePath)
{
auto deckLoader = DeckLoader(this);
if (!deckLoader.loadFromFile(filePath, DeckFileFormat::getFormatFromName(filePath), true)) {
std::optional<LoadedDeck> deckOpt =
DeckLoader::loadFromFile(filePath, DeckFileFormat::getFormatFromName(filePath), true);
if (!deckOpt) {
QMessageBox::critical(this, tr("Error"), tr("Could not open deck at %1").arg(filePath));
return;
}
emit openDeckEditor(deckLoader.getDeck());
emit openDeckEditor(deckOpt.value());
}