mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Take cluster size into account when calculating zip extracted size.
Allow passing an (optional) cluster size to round up all file sizes when calculating the total size of an extracted zip archive. This allows to check if the space on disk is actually sufficient without relying on an arbitrary headroom value which might be wrong. Addresses FS#12195. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30214 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3bb0fed345
commit
743308e882
5 changed files with 51 additions and 10 deletions
|
|
@ -140,7 +140,8 @@ void ZipInstaller::downloadDone(bool error)
|
|||
// some room for operating (also includes calculation mistakes due to
|
||||
// cluster sizes on the player).
|
||||
if((qint64)Utils::filesystemFree(m_mountpoint)
|
||||
< (zip.totalUncompressedSize() + 1000000)) {
|
||||
< (zip.totalUncompressedSize(Utils::filesystemClusterSize(m_mountpoint))
|
||||
+ 1000000)) {
|
||||
emit logItem(tr("Not enough disk space! Aborting."), LOGERROR);
|
||||
emit logProgress(1, 1);
|
||||
emit done(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue