mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 08:52:15 -07:00
Lint.
This commit is contained in:
parent
8243144cdb
commit
a1b99f5232
4 changed files with 32 additions and 41 deletions
|
|
@ -90,8 +90,8 @@ void PictureLoaderWorker::processLoadQueue()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace() << "[card: " << cardName << " set: " << setName
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< "]: No custom picture, trying to download";
|
<< "[card: " << cardName << " set: " << setName << "]: No custom picture, trying to download";
|
||||||
cardsToDownload.append(cardBeingLoaded);
|
cardsToDownload.append(cardBeingLoaded);
|
||||||
cardBeingLoaded.clear();
|
cardBeingLoaded.clear();
|
||||||
if (!downloadRunning) {
|
if (!downloadRunning) {
|
||||||
|
|
@ -140,15 +140,15 @@ bool PictureLoaderWorker::cardImageExistsOnDisk(QString &setName, QString &corre
|
||||||
}
|
}
|
||||||
imgReader.setFileName(_picsPath + ".full");
|
imgReader.setFileName(_picsPath + ".full");
|
||||||
if (imgReader.read(&image)) {
|
if (imgReader.read(&image)) {
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace() << "[card: " << correctedCardname
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< " set: " << setName << "]: Picture.full found on disk.";
|
<< "[card: " << correctedCardname << " set: " << setName << "]: Picture.full found on disk.";
|
||||||
imageLoaded(cardBeingLoaded.getCard(), image);
|
imageLoaded(cardBeingLoaded.getCard(), image);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
imgReader.setFileName(_picsPath + ".xlhq");
|
imgReader.setFileName(_picsPath + ".xlhq");
|
||||||
if (imgReader.read(&image)) {
|
if (imgReader.read(&image)) {
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace() << "[card: " << correctedCardname
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< " set: " << setName << "]: Picture.xlhq found on disk.";
|
<< "[card: " << correctedCardname << " set: " << setName << "]: Picture.xlhq found on disk.";
|
||||||
imageLoaded(cardBeingLoaded.getCard(), image);
|
imageLoaded(cardBeingLoaded.getCard(), image);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -176,10 +176,9 @@ void PictureLoaderWorker::startNextPicDownload()
|
||||||
picDownloadFailed();
|
picDownloadFailed();
|
||||||
} else {
|
} else {
|
||||||
QUrl url(picUrl);
|
QUrl url(picUrl);
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace()
|
qCDebug(PictureLoaderWorkerLog).nospace() << "[card: " << cardBeingDownloaded.getCard()->getCorrectedName()
|
||||||
<< "[card: " << cardBeingDownloaded.getCard()->getCorrectedName()
|
<< " set: " << cardBeingDownloaded.getSetName()
|
||||||
<< " set: " << cardBeingDownloaded.getSetName() << "]: Trying to fetch picture from url "
|
<< "]: Trying to fetch picture from url " << url.toDisplayString();
|
||||||
<< url.toDisplayString();
|
|
||||||
makeRequest(url);
|
makeRequest(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -323,18 +322,18 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
|
||||||
if (reply->error()) {
|
if (reply->error()) {
|
||||||
if (isFromCache) {
|
if (isFromCache) {
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace()
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< "[card: " << cardBeingDownloaded.getCard()->getName()
|
<< "[card: " << cardBeingDownloaded.getCard()->getName() << " set: " << cardBeingDownloaded.getSetName()
|
||||||
<< " set: " << cardBeingDownloaded.getSetName() << "]: Removing corrupted cache file for url "
|
<< "]: Removing corrupted cache file for url " << reply->url().toDisplayString() << " and retrying ("
|
||||||
<< reply->url().toDisplayString() << " and retrying (" << reply->errorString() << ")";
|
<< reply->errorString() << ")";
|
||||||
|
|
||||||
networkManager->cache()->remove(reply->url());
|
networkManager->cache()->remove(reply->url());
|
||||||
|
|
||||||
makeRequest(reply->url());
|
makeRequest(reply->url());
|
||||||
} else {
|
} else {
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace()
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< "[card: " << cardBeingDownloaded.getCard()->getName()
|
<< "[card: " << cardBeingDownloaded.getCard()->getName() << " set: " << cardBeingDownloaded.getSetName()
|
||||||
<< " set: " << cardBeingDownloaded.getSetName() << "]: " << (picDownload ? "Download" : "Cache search")
|
<< "]: " << (picDownload ? "Download" : "Cache search") << " failed for url "
|
||||||
<< " failed for url " << reply->url().toDisplayString() << " (" << reply->errorString() << ")";
|
<< reply->url().toDisplayString() << " (" << reply->errorString() << ")";
|
||||||
|
|
||||||
picDownloadFailed();
|
picDownloadFailed();
|
||||||
startNextPicDownload();
|
startNextPicDownload();
|
||||||
|
|
@ -350,9 +349,9 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
|
||||||
statusCode == 308) {
|
statusCode == 308) {
|
||||||
QUrl redirectUrl = reply->header(QNetworkRequest::LocationHeader).toUrl();
|
QUrl redirectUrl = reply->header(QNetworkRequest::LocationHeader).toUrl();
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace()
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< "[card: " << cardBeingDownloaded.getCard()->getName()
|
<< "[card: " << cardBeingDownloaded.getCard()->getName() << " set: " << cardBeingDownloaded.getSetName()
|
||||||
<< " set: " << cardBeingDownloaded.getSetName() << "]: following "
|
<< "]: following " << (isFromCache ? "cached redirect" : "redirect") << " to "
|
||||||
<< (isFromCache ? "cached redirect" : "redirect") << " to " << redirectUrl.toDisplayString();
|
<< redirectUrl.toDisplayString();
|
||||||
makeRequest(redirectUrl);
|
makeRequest(redirectUrl);
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
return;
|
return;
|
||||||
|
|
@ -363,8 +362,7 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
|
||||||
|
|
||||||
if (imageIsBlackListed(picData)) {
|
if (imageIsBlackListed(picData)) {
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace()
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< "[card: " << cardBeingDownloaded.getCard()->getName()
|
<< "[card: " << cardBeingDownloaded.getCard()->getName() << " set: " << cardBeingDownloaded.getSetName()
|
||||||
<< " set: " << cardBeingDownloaded.getSetName()
|
|
||||||
<< "]: Picture found, but blacklisted, will consider it as not found";
|
<< "]: Picture found, but blacklisted, will consider it as not found";
|
||||||
|
|
||||||
picDownloadFailed();
|
picDownloadFailed();
|
||||||
|
|
@ -399,18 +397,18 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
|
||||||
logSuccessMessage = true;
|
logSuccessMessage = true;
|
||||||
} else {
|
} else {
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace()
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< "[card: " << cardBeingDownloaded.getCard()->getName()
|
<< "[card: " << cardBeingDownloaded.getCard()->getName() << " set: " << cardBeingDownloaded.getSetName()
|
||||||
<< " set: " << cardBeingDownloaded.getSetName() << "]: Possible " << (isFromCache ? "cached" : "downloaded")
|
<< "]: Possible " << (isFromCache ? "cached" : "downloaded") << " picture at "
|
||||||
<< " picture at " << reply->url().toDisplayString() << " could not be loaded: " << reply->errorString();
|
<< reply->url().toDisplayString() << " could not be loaded: " << reply->errorString();
|
||||||
|
|
||||||
picDownloadFailed();
|
picDownloadFailed();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logSuccessMessage) {
|
if (logSuccessMessage) {
|
||||||
qCDebug(PictureLoaderWorkerLog).nospace()
|
qCDebug(PictureLoaderWorkerLog).nospace()
|
||||||
<< "[card: " << cardBeingDownloaded.getCard()->getName()
|
<< "[card: " << cardBeingDownloaded.getCard()->getName() << " set: " << cardBeingDownloaded.getSetName()
|
||||||
<< " set: " << cardBeingDownloaded.getSetName() << "]: Image successfully "
|
<< "]: Image successfully " << (isFromCache ? "loaded from cached" : "downloaded from") << " url "
|
||||||
<< (isFromCache ? "loaded from cached" : "downloaded from") << " url " << reply->url().toDisplayString();
|
<< reply->url().toDisplayString();
|
||||||
}
|
}
|
||||||
|
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
|
|
|
||||||
|
|
@ -582,8 +582,7 @@ LoadStatus CardDatabase::loadCardDatabase(const QString &path)
|
||||||
}
|
}
|
||||||
|
|
||||||
int msecs = startTime.msecsTo(QTime::currentTime());
|
int msecs = startTime.msecsTo(QTime::currentTime());
|
||||||
qCDebug(CardDatabaseLoadingLog) << "Path =" << path
|
qCDebug(CardDatabaseLoadingLog) << "Path =" << path << "Status =" << tempLoadStatus << "Cards =" << cards.size()
|
||||||
<< "Status =" << tempLoadStatus << "Cards =" << cards.size()
|
|
||||||
<< "Sets =" << sets.size() << QString("%1ms").arg(msecs);
|
<< "Sets =" << sets.size() << QString("%1ms").arg(msecs);
|
||||||
|
|
||||||
return tempLoadStatus;
|
return tempLoadStatus;
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,7 @@ void CockatriceXml3Parser::parseFile(QIODevice &device)
|
||||||
} else if (name == "cards") {
|
} else if (name == "cards") {
|
||||||
loadCardsFromXml(xml);
|
loadCardsFromXml(xml);
|
||||||
} else if (!name.isEmpty()) {
|
} else if (!name.isEmpty()) {
|
||||||
qCDebug(CockatriceXml3Log)
|
qCDebug(CockatriceXml3Log) << "Unknown item" << name << ", trying to continue anyway";
|
||||||
<< "Unknown item" << name << ", trying to continue anyway";
|
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -94,8 +93,7 @@ void CockatriceXml3Parser::loadSetsFromXml(QXmlStreamReader &xml)
|
||||||
releaseDate =
|
releaseDate =
|
||||||
QDate::fromString(xml.readElementText(QXmlStreamReader::IncludeChildElements), Qt::ISODate);
|
QDate::fromString(xml.readElementText(QXmlStreamReader::IncludeChildElements), Qt::ISODate);
|
||||||
} else if (!name.isEmpty()) {
|
} else if (!name.isEmpty()) {
|
||||||
qCDebug(CockatriceXml3Log)
|
qCDebug(CockatriceXml3Log) << "Unknown set property" << name << ", trying to continue anyway";
|
||||||
<< "Unknown set property" << name << ", trying to continue anyway";
|
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -265,8 +263,7 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
relatedCards << relation;
|
relatedCards << relation;
|
||||||
}
|
}
|
||||||
} else if (!xmlName.isEmpty()) {
|
} else if (!xmlName.isEmpty()) {
|
||||||
qCDebug(CockatriceXml3Log)
|
qCDebug(CockatriceXml3Log) << "Unknown card property" << xmlName << ", trying to continue anyway";
|
||||||
<< "Unknown card property" << xmlName << ", trying to continue anyway";
|
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,7 @@ void CockatriceXml4Parser::parseFile(QIODevice &device)
|
||||||
} else if (xmlName == "cards") {
|
} else if (xmlName == "cards") {
|
||||||
loadCardsFromXml(xml);
|
loadCardsFromXml(xml);
|
||||||
} else if (!xmlName.isEmpty()) {
|
} else if (!xmlName.isEmpty()) {
|
||||||
qCDebug(CockatriceXml4Log)
|
qCDebug(CockatriceXml4Log) << "Unknown item" << xmlName << ", trying to continue anyway";
|
||||||
<< "Unknown item" << xmlName << ", trying to continue anyway";
|
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -97,8 +96,7 @@ void CockatriceXml4Parser::loadSetsFromXml(QXmlStreamReader &xml)
|
||||||
} else if (xmlName == "priority") {
|
} else if (xmlName == "priority") {
|
||||||
priority = xml.readElementText(QXmlStreamReader::IncludeChildElements).toShort();
|
priority = xml.readElementText(QXmlStreamReader::IncludeChildElements).toShort();
|
||||||
} else if (!xmlName.isEmpty()) {
|
} else if (!xmlName.isEmpty()) {
|
||||||
qCDebug(CockatriceXml4Log)
|
qCDebug(CockatriceXml4Log) << "Unknown set property" << xmlName << ", trying to continue anyway";
|
||||||
<< "Unknown set property" << xmlName << ", trying to continue anyway";
|
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -231,8 +229,7 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
relatedCards << relation;
|
relatedCards << relation;
|
||||||
}
|
}
|
||||||
} else if (!xmlName.isEmpty()) {
|
} else if (!xmlName.isEmpty()) {
|
||||||
qCDebug(CockatriceXml4Log)
|
qCDebug(CockatriceXml4Log) << "Unknown card property" << xmlName << ", trying to continue anyway";
|
||||||
<< "Unknown card property" << xmlName << ", trying to continue anyway";
|
|
||||||
xml.skipCurrentElement();
|
xml.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue