mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
Fix #34
This is @mcallahan's patch — see #35. I had to apply this diff by hand, because both `git` and `patch` refused to apply it and I didn't know how to resolve that. Consequently, there might be an error.
This commit is contained in:
parent
0da2647a7b
commit
629668d7c0
4 changed files with 9 additions and 11 deletions
|
|
@ -4,9 +4,8 @@
|
|||
#include "decklist.h"
|
||||
|
||||
const QStringList DeckLoader::fileNameFilters = QStringList()
|
||||
<< QObject::tr("All files (*.*)")
|
||||
<< QObject::tr("Cockatrice decks (*.cod)")
|
||||
<< QObject::tr("Plain text decks (*.dec *.mwDeck)");
|
||||
<< QObject::tr("Common deck formats (*.cod *.dec *.mwDeck)")
|
||||
<< QObject::tr("All files (*.*)");
|
||||
|
||||
DeckLoader::DeckLoader()
|
||||
: DeckList(),
|
||||
|
|
@ -91,11 +90,10 @@ bool DeckLoader::saveToFile(const QString &fileName, FileFormat fmt)
|
|||
return result;
|
||||
}
|
||||
|
||||
DeckLoader::FileFormat DeckLoader::getFormatFromNameFilter(const QString &selectedNameFilter)
|
||||
DeckLoader::FileFormat DeckLoader::getFormatFromName(const QString &fileName)
|
||||
{
|
||||
switch (fileNameFilters.indexOf(selectedNameFilter)) {
|
||||
case 1: return CockatriceFormat;
|
||||
case 2: return PlainTextFormat;
|
||||
if (fileName.endsWith(".cod", Qt::CaseInsensitive)) {
|
||||
return CockatriceFormat;
|
||||
}
|
||||
return PlainTextFormat;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue