23 #ifndef __IP2CUPDATER_H__ 24 #define __IP2CUPDATER_H__ 27 #include <QNetworkReply> 52 void downloadDatabase(
const QString &savePath);
53 const QByteArray &downloadedData();
68 bool hasDownloadedData()
const 70 return !retrievedData.isEmpty();
72 bool hasRollbackData()
const 74 return !rollbackData.isEmpty();
77 bool isWorking()
const;
104 bool rollback(
const QString &savePath);
121 void downloadProgress(qint64 value, qint64 max);
128 static const QUrl dbChecksumUrl();
129 static const QUrl dbDownloadUrl();
131 QNetworkAccessManager *pNetworkAccessManager;
132 QNetworkReply *pCurrentNetworkReply;
134 QString lastAsyncCallPath;
135 QByteArray retrievedData;
136 QByteArray rollbackData;
139 void get(
const QUrl &url,
const char *finishedSlot);
140 bool handleRedirect(QNetworkReply &reply,
const char *finishedSlot);
141 bool save(
const QByteArray &saveWhat,
const QString &savePath);
144 void checksumDownloadFinished();
145 void downloadFinished();
IP2CUpdater is responsible for downloading a new version of database from the site.
void databaseDownloadFinished(const QByteArray &downloadedData)
In case of failure the downloadedData array will be empty.
bool saveDownloadedData(const QString &savePath)
Saves recently downloaded data to the specified file.
bool getRollbackData(const QString &databasePath)
Obtains rollback data from specified file.
void needsUpdate(const QString &filePath)
Checks if IP2C file must be updated.
bool rollback(const QString &savePath)
Saves rollback data to the specified file. This data must be first obtained through the getRollbackDa...
void updateNeeded(int status)
Emitted status is one of UpdateStatus enum values.