Added better support for custom card images by prioritizing a check for card images in <Pictures path>/<CUSTOM> before all other checks.

This commit is contained in:
pliu037 2014-07-08 16:24:51 -04:00
parent 7f77082466
commit 1a601d9509

View file

@ -129,21 +129,22 @@ void PictureLoader::processLoadQueue()
QString setName = ptl.getSetName(); QString setName = ptl.getSetName();
QImage image; QImage image;
if (!image.load(QString("%1/%2/%3.full.jpg").arg(picsPath).arg(setName).arg(correctedName))) if (!image.load(QString("%1/%2/%3.full.jpg").arg(picsPath).arg("CUSTOM").arg(correctedName)))
if (!image.load(QString("%1/%2/%3%4.full.jpg").arg(picsPath).arg(setName).arg(correctedName).arg(1))) if (!image.load(QString("%1/%2/%3.full.jpg").arg(picsPath).arg(setName).arg(correctedName)))
if (!image.load(QString("%1/%2/%3/%4.full.jpg").arg(picsPath).arg("downloadedPics").arg(setName).arg(correctedName))) { //if (!image.load(QString("%1/%2/%3%4.full.jpg").arg(picsPath).arg(setName).arg(correctedName).arg(1)))
if (picDownload) { if (!image.load(QString("%1/%2/%3/%4.full.jpg").arg(picsPath).arg("downloadedPics").arg(setName).arg(correctedName))) {
cardsToDownload.append(ptl); if (picDownload) {
if (!downloadRunning) cardsToDownload.append(ptl);
startNextPicDownload(); if (!downloadRunning)
} else { startNextPicDownload();
if (ptl.nextSet()) } else {
loadQueue.prepend(ptl); if (ptl.nextSet())
else loadQueue.prepend(ptl);
emit imageLoaded(ptl.getCard(), QImage()); else
emit imageLoaded(ptl.getCard(), QImage());
}
continue;
} }
continue;
}
emit imageLoaded(ptl.getCard(), image); emit imageLoaded(ptl.getCard(), image);
} }