Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
bda9768b
Commit
bda9768b
authored
Apr 21, 2010
by
Max-Wilhelm Bruker
Browse files
qt 4.5 compile fix
parent
cb045907
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabase.cpp
View file @
bda9768b
...
...
@@ -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/"
+
card
BeingDownloaded
->
getCorrectedName
()
+
".full.jpg"
);
if
(
!
newPic
.
open
(
QIODevice
::
WriteOnly
))
return
;
newPic
.
write
(
picData
);
newPic
.
close
();
card
->
updatePixmapCache
();
card
BeingDownloaded
->
updatePixmapCache
();
}
reply
->
deleteLater
();
...
...
cockatrice/src/carddatabase.h
View file @
bda9768b
...
...
@@ -7,6 +7,7 @@
#include
<QDataStream>
#include
<QList>
#include
<QXmlStreamReader>
#include
<QNetworkRequest>
class
CardDatabase
;
class
CardInfo
;
...
...
@@ -96,6 +97,7 @@ protected:
QHash
<
QString
,
CardSet
*>
setHash
;
QNetworkAccessManager
*
networkManager
;
QList
<
CardInfo
*>
cardsToDownload
;
CardInfo
*
cardBeingDownloaded
;
bool
downloadRunning
;
CardInfo
*
noCard
;
private:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment