From 0c4b09891bfe7142bb6cb48a853046dc727c3d75 Mon Sep 17 00:00:00 2001 From: xawotihs Date: Sun, 12 Jan 2014 22:40:45 +0100 Subject: [PATCH] Removed hardcoded testing values and used 32 bits file size instead of 64 bits. --- JGE/include/Downloader.h | 10 +++++----- JGE/src/Downloader.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/JGE/include/Downloader.h b/JGE/include/Downloader.h index f03a6f998..3b7ea66d5 100644 --- a/JGE/include/Downloader.h +++ b/JGE/include/Downloader.h @@ -65,8 +65,8 @@ protected: string mETag; DownloadStatus mDownloadStatus; bool mUpgradeAvailable; - uint64_t mTotalSize; - uint64_t mCurrentSize; + uint32_t mTotalSize; + uint32_t mCurrentSize; ofstream mFile; #ifdef QT_CONFIG QNetworkReply* mNetworkReply; @@ -79,8 +79,8 @@ public: string remoteResourceURL="", string ETag = "", DownloadStatus downloadStatus=NOT_PRESENT, - uint64_t totalSize = 0, - uint64_t currentSize = 0); + uint32_t totalSize = 0, + uint32_t currentSize = 0); ~DownloadRequest(); static bool NetworkIsAccessible(); @@ -92,7 +92,7 @@ public: void startHead(); DownloadStatus getDownloadStatus() const { return mDownloadStatus; }; bool upgradeAvailable() const { return mUpgradeAvailable; }; - void getSizes(uint64_t& totalSize, uint64_t¤tSize) { + void getSizes(uint32_t& totalSize, uint32_t¤tSize) { totalSize = mTotalSize; currentSize = mCurrentSize; }; diff --git a/JGE/src/Downloader.cpp b/JGE/src/Downloader.cpp index 624c1b1e0..4cb92534a 100644 --- a/JGE/src/Downloader.cpp +++ b/JGE/src/Downloader.cpp @@ -12,8 +12,8 @@ DownloadRequest::DownloadRequest(string localPath, string remoteResourceURL, string ETag, DownloadStatus downloadStatus, - uint64_t totalSize, - uint64_t currentSize): + uint32_t totalSize, + uint32_t currentSize): mLocalPath(localPath), mRemoteResourceURL(remoteResourceURL), mRequestedRemoteResourceURL(remoteResourceURL), @@ -33,7 +33,7 @@ void DownloadRequest::startHead() { #ifdef QT_CONFIG 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); connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded())); #endif