4
0
mirror of https://github.com/QuasarApp/QtAndroidTools.git synced 2025-05-01 23:19:33 +00:00

Added function for abort, peuse and continue the apk expansions file download

This commit is contained in:
FalsinSoft 2019-01-14 21:50:47 +01:00
parent 25d2d91cbe
commit 741aa75595
2 changed files with 27 additions and 10 deletions

@ -213,7 +213,22 @@ QString QAndroidApkExpansionFiles::patchFileName()
return FileName;
}
void QAndroidApkExpansionFiles::sendRequest(REQUEST_ID requestID)
void QAndroidApkExpansionFiles::abortDownload()
{
SendRequest(REQUEST_ABORT_DOWNLOAD);
}
void QAndroidApkExpansionFiles::pauseDownload()
{
SendRequest(REQUEST_PAUSE_DOWNLOAD);
}
void QAndroidApkExpansionFiles::continueDownload()
{
SendRequest(REQUEST_CONTINUE_DOWNLOAD);
}
void QAndroidApkExpansionFiles::SendRequest(REQUEST_ID requestID)
{
if(m_JavaApkExpansionDownloader.isValid())
{

@ -47,7 +47,6 @@ class QAndroidApkExpansionFiles : public QObject
Q_DISABLE_COPY(QAndroidApkExpansionFiles)
Q_ENUMS(DOWNLOAD_STATE)
Q_ENUMS(APKEF_STATE)
Q_ENUMS(REQUEST_ID)
Q_ENUMS(STRING_ID)
Q_OBJECT
@ -90,13 +89,6 @@ public:
APKEF_INVALID_SALT,
APKEF_UNKNOWN_ERROR
};
enum REQUEST_ID
{
REQUEST_ABORT_DOWNLOAD = 0,
REQUEST_PAUSE_DOWNLOAD,
REQUEST_CONTINUE_DOWNLOAD,
REQUEST_DOWNLOAD_STATUS
};
enum STRING_ID
{
STRING_IDLE = 0,
@ -130,7 +122,9 @@ public:
Q_INVOKABLE QString patchFileName();
Q_INVOKABLE APKEF_STATE startDownloadFiles();
Q_INVOKABLE QString getString(int stringID);
Q_INVOKABLE void sendRequest(REQUEST_ID requestID);
Q_INVOKABLE void abortDownload();
Q_INVOKABLE void pauseDownload();
Q_INVOKABLE void continueDownload();
const QString& getBase64PublicKey() const;
void setBase64PublicKey(const QString &Base64PublicKey);
@ -163,4 +157,12 @@ private:
APP_STATE_DESTROY
};
void SetNewAppState(APP_STATE NewState);
enum REQUEST_ID
{
REQUEST_ABORT_DOWNLOAD = 0,
REQUEST_PAUSE_DOWNLOAD,
REQUEST_CONTINUE_DOWNLOAD,
REQUEST_DOWNLOAD_STATUS
};
void SendRequest(REQUEST_ID requestID);
};