Removed hardcoded testing values and used 32 bits file size instead of 64 bits.

This commit is contained in:
xawotihs
2014-01-12 22:40:45 +01:00
parent 25955303e7
commit 0c4b09891b
2 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -65,8 +65,8 @@ protected:
string mETag; string mETag;
DownloadStatus mDownloadStatus; DownloadStatus mDownloadStatus;
bool mUpgradeAvailable; bool mUpgradeAvailable;
uint64_t mTotalSize; uint32_t mTotalSize;
uint64_t mCurrentSize; uint32_t mCurrentSize;
ofstream mFile; ofstream mFile;
#ifdef QT_CONFIG #ifdef QT_CONFIG
QNetworkReply* mNetworkReply; QNetworkReply* mNetworkReply;
@@ -79,8 +79,8 @@ public:
string remoteResourceURL="", string remoteResourceURL="",
string ETag = "", string ETag = "",
DownloadStatus downloadStatus=NOT_PRESENT, DownloadStatus downloadStatus=NOT_PRESENT,
uint64_t totalSize = 0, uint32_t totalSize = 0,
uint64_t currentSize = 0); uint32_t currentSize = 0);
~DownloadRequest(); ~DownloadRequest();
static bool NetworkIsAccessible(); static bool NetworkIsAccessible();
@@ -92,7 +92,7 @@ public:
void startHead(); void startHead();
DownloadStatus getDownloadStatus() const { return mDownloadStatus; }; DownloadStatus getDownloadStatus() const { return mDownloadStatus; };
bool upgradeAvailable() const { return mUpgradeAvailable; }; bool upgradeAvailable() const { return mUpgradeAvailable; };
void getSizes(uint64_t& totalSize, uint64_t&currentSize) { void getSizes(uint32_t& totalSize, uint32_t&currentSize) {
totalSize = mTotalSize; totalSize = mTotalSize;
currentSize = mCurrentSize; currentSize = mCurrentSize;
}; };
+3 -3
View File
@@ -12,8 +12,8 @@ DownloadRequest::DownloadRequest(string localPath,
string remoteResourceURL, string remoteResourceURL,
string ETag, string ETag,
DownloadStatus downloadStatus, DownloadStatus downloadStatus,
uint64_t totalSize, uint32_t totalSize,
uint64_t currentSize): uint32_t currentSize):
mLocalPath(localPath), mLocalPath(localPath),
mRemoteResourceURL(remoteResourceURL), mRemoteResourceURL(remoteResourceURL),
mRequestedRemoteResourceURL(remoteResourceURL), mRequestedRemoteResourceURL(remoteResourceURL),
@@ -33,7 +33,7 @@ void DownloadRequest::startHead()
{ {
#ifdef QT_CONFIG #ifdef QT_CONFIG
QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str()))); QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str())));
request.setRawHeader("If-None-Match", "e42fe0b592d2b34965e2e92742b0d9c7");//mETag.c_str()); request.setRawHeader("If-None-Match", mETag.c_str());
mNetworkReply = networkAccessManager.head(request); mNetworkReply = networkAccessManager.head(request);
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded())); connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
#endif #endif