mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 16:32:16 -07:00
Add Deck Loader logging category.
This commit is contained in:
parent
8b5ba5a3ca
commit
7d76221e39
2 changed files with 8 additions and 4 deletions
|
|
@ -1,2 +1,3 @@
|
|||
[Rules]
|
||||
picture_loader.debug = true
|
||||
picture_loader.debug = true
|
||||
deck_loader.debug = true
|
||||
|
|
@ -10,6 +10,9 @@
|
|||
#include <QFileInfo>
|
||||
#include <QRegularExpression>
|
||||
#include <QStringList>
|
||||
#include <qloggingcategory.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(DeckLoaderLog, "deck_loader")
|
||||
|
||||
const QStringList DeckLoader::fileNameFilters = QStringList()
|
||||
<< QObject::tr("Common deck formats (*.cod *.dec *.dek *.txt *.mwDeck)")
|
||||
|
|
@ -49,9 +52,9 @@ bool DeckLoader::loadFromFile(const QString &fileName, FileFormat fmt, bool user
|
|||
break;
|
||||
case CockatriceFormat: {
|
||||
result = loadFromFile_Native(&file);
|
||||
qDebug() << "Loaded from" << fileName << "-" << result;
|
||||
qCDebug(DeckLoaderLog) << "Loaded from" << fileName << "-" << result;
|
||||
if (!result) {
|
||||
qDebug() << "Retrying as plain format";
|
||||
qCDebug(DeckLoaderLog) << "Retrying as plain format";
|
||||
file.seek(0);
|
||||
result = loadFromFile_Plain(&file);
|
||||
fmt = PlainTextFormat;
|
||||
|
|
@ -73,7 +76,7 @@ bool DeckLoader::loadFromFile(const QString &fileName, FileFormat fmt, bool user
|
|||
emit deckLoaded();
|
||||
}
|
||||
|
||||
qDebug() << "Deck was loaded -" << result;
|
||||
qCDebug(DeckLoaderLog) << "Deck was loaded -" << result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue