mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
qt 4.5 compile fix
This commit is contained in:
parent
cb045907cb
commit
bda9768b1d
2 changed files with 7 additions and 7 deletions
|
|
@ -331,22 +331,20 @@ void CardDatabase::startPicDownload(CardInfo *card)
|
|||
void CardDatabase::startNextPicDownload()
|
||||
{
|
||||
if (cardsToDownload.isEmpty()) {
|
||||
cardBeingDownloaded = 0;
|
||||
downloadRunning = false;
|
||||
return;
|
||||
}
|
||||
|
||||
downloadRunning = true;
|
||||
|
||||
CardInfo *card = cardsToDownload.takeFirst();
|
||||
QNetworkRequest req(QUrl(card->getPicURL()));
|
||||
req.setOriginatingObject(card);
|
||||
cardBeingDownloaded = cardsToDownload.takeFirst();
|
||||
QNetworkRequest req(QUrl(cardBeingDownloaded->getPicURL()));
|
||||
networkManager->get(req);
|
||||
}
|
||||
|
||||
void CardDatabase::picDownloadFinished(QNetworkReply *reply)
|
||||
{
|
||||
CardInfo *card = static_cast<CardInfo *>(reply->request().originatingObject());
|
||||
|
||||
QString picsPath = settingsCache->getPicsPath();
|
||||
const QByteArray &picData = reply->readAll();
|
||||
QPixmap testPixmap;
|
||||
|
|
@ -357,13 +355,13 @@ void CardDatabase::picDownloadFinished(QNetworkReply *reply)
|
|||
return;
|
||||
dir.mkdir("downloadedPics");
|
||||
}
|
||||
QFile newPic(picsPath + "/downloadedPics/" + card->getCorrectedName() + ".full.jpg");
|
||||
QFile newPic(picsPath + "/downloadedPics/" + cardBeingDownloaded->getCorrectedName() + ".full.jpg");
|
||||
if (!newPic.open(QIODevice::WriteOnly))
|
||||
return;
|
||||
newPic.write(picData);
|
||||
newPic.close();
|
||||
|
||||
card->updatePixmapCache();
|
||||
cardBeingDownloaded->updatePixmapCache();
|
||||
}
|
||||
|
||||
reply->deleteLater();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue