mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
rewrote oracle importer
This commit is contained in:
parent
af0d72c0e6
commit
ae6803f9f2
10 changed files with 535 additions and 452 deletions
|
|
@ -4,7 +4,6 @@
|
|||
#include <carddatabase.h>
|
||||
#include <QHttp>
|
||||
|
||||
class QProgressDialog;
|
||||
class QBuffer;
|
||||
|
||||
class SetToDownload {
|
||||
|
|
@ -22,22 +21,27 @@ class OracleImporter : public CardDatabase {
|
|||
Q_OBJECT
|
||||
private:
|
||||
QList<SetToDownload> setsToDownload;
|
||||
QString pictureUrl;
|
||||
QString pictureUrl, setUrl;
|
||||
QString dataDir;
|
||||
int setIndex;
|
||||
int reqId;
|
||||
QBuffer *buffer;
|
||||
QHttp *http;
|
||||
QProgressDialog *progressDialog;
|
||||
QString normalizeName(QString);
|
||||
QString getURLFromName(QString);
|
||||
|
||||
CardInfo *addCard(QString cardName, const QString &cardCost, const QString &cardType, const QString &cardPT, const QStringList &cardText);
|
||||
private slots:
|
||||
void httpRequestFinished(int requestId, bool error);
|
||||
void readResponseHeader(const QHttpResponseHeader &responseHeader);
|
||||
signals:
|
||||
void setIndexChanged(int cardsImported, int setIndex, const QString &nextSetName);
|
||||
void dataReadProgress(int bytesRead, int totalBytes);
|
||||
public:
|
||||
OracleImporter(const QString &_dataDir);
|
||||
void importOracleFile(CardSet *set);
|
||||
OracleImporter(const QString &_dataDir, QObject *parent = 0);
|
||||
int importTextSpoiler(CardSet *set, const QByteArray &data);
|
||||
void downloadNextFile();
|
||||
int getSetsCount() const { return setsToDownload.size(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue