1
0
Fork 0
forked from len0rd/rockbox

Make Rockbox Utility error out if the zip file its going to install requires more space than left on the device. Calculation adds a safety space of 1MB so you need at least 1MB more free space than the extracted archive. This also catches differences due to the size calculation not taking cluster losses into account. Free disk space is also displayed in the sysinfo dialog. Fixes FS#9417.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19428 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2008-12-13 20:09:31 +00:00
parent b42f379fa3
commit bc7917daeb
6 changed files with 100 additions and 12 deletions

View file

@ -21,6 +21,7 @@
#include <QtCore>
//! @brief extract archive to destination
UnZip::ErrorCode RbUnZip::extractArchive(const QString& dest)
{
QStringList files = this->fileList();
@ -41,8 +42,25 @@ UnZip::ErrorCode RbUnZip::extractArchive(const QString& dest)
return error;
}
//! @brief abort an extractArchive() operation.
void RbUnZip::abortUnzip(void)
{
m_abortunzip = true;
}
//! @brief return total size of extracted files in archive.
qulonglong RbUnZip::totalSize(void)
{
QList<ZipEntry> l = this->entryList();
qulonglong total = 0;
int i = l.size();
while(i--)
total += l.at(i).uncompressedSize;
return total;
}