summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/ziputil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base/ziputil.cpp')
-rw-r--r--rbutil/rbutilqt/base/ziputil.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/ziputil.cpp b/rbutil/rbutilqt/base/ziputil.cpp
index ed8f17eefe..4396fa5e87 100644
--- a/rbutil/rbutilqt/base/ziputil.cpp
+++ b/rbutil/rbutilqt/base/ziputil.cpp
@@ -205,7 +205,7 @@ bool ZipUtil::appendFileToArchive(QString& file, QString& basedir)
205 205
206 206
207//! @brief calculate total size of extracted files 207//! @brief calculate total size of extracted files
208qint64 ZipUtil::totalUncompressedSize(void) 208qint64 ZipUtil::totalUncompressedSize(unsigned int clustersize)
209{ 209{
210 qint64 uncompressed = 0; 210 qint64 uncompressed = 0;
211 211
@@ -214,10 +214,23 @@ qint64 ZipUtil::totalUncompressedSize(void)
214 return -1; 214 return -1;
215 } 215 }
216 int max = items.size(); 216 int max = items.size();
217 for(int i = 0; i < max; ++i) { 217 if(clustersize > 0) {
218 uncompressed += items.at(i).uncompressedSize; 218 for(int i = 0; i < max; ++i) {
219 qint64 item = items.at(i).uncompressedSize;
220 uncompressed += (item + clustersize - (item % clustersize));
221 }
222 }
223 else {
224 for(int i = 0; i < max; ++i) {
225 uncompressed += items.at(i).uncompressedSize;
226 }
227 }
228 if(clustersize > 0) {
229 qDebug() << "[ZipUtil] calculation rounded to cluster size for each file:"
230 << clustersize;
219 } 231 }
220 qDebug() << "[ZipUtil] size of archive files uncompressed:" << uncompressed; 232 qDebug() << "[ZipUtil] size of archive files uncompressed:"
233 << uncompressed;
221 return uncompressed; 234 return uncompressed;
222} 235}
223 236