mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 08:52:15 -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]
|
[Rules]
|
||||||
picture_loader.debug = true
|
picture_loader.debug = true
|
||||||
|
deck_loader.debug = true
|
||||||
|
|
@ -10,6 +10,9 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <qloggingcategory.h>
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(DeckLoaderLog, "deck_loader")
|
||||||
|
|
||||||
const QStringList DeckLoader::fileNameFilters = QStringList()
|
const QStringList DeckLoader::fileNameFilters = QStringList()
|
||||||
<< QObject::tr("Common deck formats (*.cod *.dec *.dek *.txt *.mwDeck)")
|
<< 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;
|
break;
|
||||||
case CockatriceFormat: {
|
case CockatriceFormat: {
|
||||||
result = loadFromFile_Native(&file);
|
result = loadFromFile_Native(&file);
|
||||||
qDebug() << "Loaded from" << fileName << "-" << result;
|
qCDebug(DeckLoaderLog) << "Loaded from" << fileName << "-" << result;
|
||||||
if (!result) {
|
if (!result) {
|
||||||
qDebug() << "Retrying as plain format";
|
qCDebug(DeckLoaderLog) << "Retrying as plain format";
|
||||||
file.seek(0);
|
file.seek(0);
|
||||||
result = loadFromFile_Plain(&file);
|
result = loadFromFile_Plain(&file);
|
||||||
fmt = PlainTextFormat;
|
fmt = PlainTextFormat;
|
||||||
|
|
@ -73,7 +76,7 @@ bool DeckLoader::loadFromFile(const QString &fileName, FileFormat fmt, bool user
|
||||||
emit deckLoaded();
|
emit deckLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "Deck was loaded -" << result;
|
qCDebug(DeckLoaderLog) << "Deck was loaded -" << result;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue