mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 01:26:30 +00:00
Changed: Computes size of downloaded files, see #279
This commit is contained in:
parent
81300b8b13
commit
07d72c133b
2 changed files with 7 additions and 2 deletions
|
@ -264,6 +264,11 @@ void CUninstallDialog::updateSizes()
|
|||
++it;
|
||||
}
|
||||
|
||||
// downloaded files
|
||||
qint64 bytes = getDirectorySize(config->getInstallationDirectory(), false);
|
||||
|
||||
emit updateSize(m_downloadedFilesIndex, qBytesToHumanReadable(bytes));
|
||||
|
||||
emit updateLayout();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ QString qBytesToHumanReadable(qint64 bytes)
|
|||
return QString::fromUtf8(NLMISC::bytesToHumanReadable(bytes).c_str());
|
||||
}
|
||||
|
||||
qint64 getDirectorySize(const QString &directory)
|
||||
qint64 getDirectorySize(const QString &directory, bool recursize)
|
||||
{
|
||||
qint64 size = 0;
|
||||
|
||||
|
@ -52,7 +52,7 @@ qint64 getDirectorySize(const QString &directory)
|
|||
|
||||
if (fileInfo.isDir())
|
||||
{
|
||||
size += getDirectorySize(fileInfo.absoluteFilePath());
|
||||
if (recursize) size += getDirectorySize(fileInfo.absoluteFilePath(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue