Get file format from name.

This commit is contained in:
Lukas Brübach 2025-01-27 08:22:33 +01:00
parent 4d791f4d7a
commit 7fee85ac64
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor)
void TabDeckStorageVisual::actOpenLocalDeck(QMouseEvent * /*event*/, DeckPreviewWidget *instance)
{
DeckLoader deckLoader;
if (!deckLoader.loadFromFile(instance->filePath, DeckLoader::CockatriceFormat, true)) {
if (!deckLoader.loadFromFile(instance->filePath, DeckLoader::getFormatFromName(instance->filePath), true)) {
return;
}

View file

@ -44,7 +44,7 @@ void DeckPreviewTagAdditionWidget::mousePressEvent(QMouseEvent *event)
bool canAddTags = true;
if (parent->deckLoader->getLastFileFormat() != DeckLoader::CockatriceFormat) {
if (DeckLoader::getFormatFromName(parent->parent->filePath) != DeckLoader::CockatriceFormat) {
canAddTags = false;
// Retrieve saved preference if the prompt is disabled
if (!SettingsCache::instance().getVisualDeckStoragePromptForConversion()) {