mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-28 01:23:55 -07:00
Get file format from name. (#5532)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
5d1e905255
commit
33d8edeb9a
2 changed files with 2 additions and 2 deletions
|
|
@ -25,7 +25,7 @@ TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor)
|
||||||
void TabDeckStorageVisual::actOpenLocalDeck(QMouseEvent * /*event*/, DeckPreviewWidget *instance)
|
void TabDeckStorageVisual::actOpenLocalDeck(QMouseEvent * /*event*/, DeckPreviewWidget *instance)
|
||||||
{
|
{
|
||||||
DeckLoader deckLoader;
|
DeckLoader deckLoader;
|
||||||
if (!deckLoader.loadFromFile(instance->filePath, DeckLoader::CockatriceFormat, true)) {
|
if (!deckLoader.loadFromFile(instance->filePath, DeckLoader::getFormatFromName(instance->filePath), true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ void DeckPreviewTagAdditionWidget::mousePressEvent(QMouseEvent *event)
|
||||||
|
|
||||||
bool canAddTags = true;
|
bool canAddTags = true;
|
||||||
|
|
||||||
if (parent->deckLoader->getLastFileFormat() != DeckLoader::CockatriceFormat) {
|
if (DeckLoader::getFormatFromName(parent->parent->filePath) != DeckLoader::CockatriceFormat) {
|
||||||
canAddTags = false;
|
canAddTags = false;
|
||||||
// Retrieve saved preference if the prompt is disabled
|
// Retrieve saved preference if the prompt is disabled
|
||||||
if (!SettingsCache::instance().getVisualDeckStoragePromptForConversion()) {
|
if (!SettingsCache::instance().getVisualDeckStoragePromptForConversion()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue