From 7ee609ae859a7374cd7b78bce54f1e5d39303666 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 14 Aug 2016 12:47:56 +0200 Subject: [PATCH] Changed: Allow to get size of a directory recursively or not, see #279 --HG-- branch : develop --- .../tools/client/ryzom_installer/src/operationdialog.cpp | 4 ++-- .../tools/client/ryzom_installer/src/uninstalldialog.cpp | 4 ++-- code/ryzom/tools/client/ryzom_installer/src/utils.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 1a4cf9f13..73fc76149 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -920,7 +920,7 @@ bool COperationDialog::createAddRemoveEntry() settings.setValue("DisplayIcon", nativeFullPath + ",0"); settings.setValue("DisplayName", QApplication::applicationName()); settings.setValue("DisplayVersion", RYZOM_VERSION); - settings.setValue("EstimatedSize", getDirectorySize(config->getInstallationDirectory())); + settings.setValue("EstimatedSize", getDirectorySize(config->getInstallationDirectory(), true)); settings.setValue("InstallDate", QDateTime::currentDateTime().toString("Ymd")); settings.setValue("InstallLocation", config->getInstallationDirectory()); settings.setValue("MajorVersion", versionTokens[0].toInt()); @@ -965,7 +965,7 @@ bool COperationDialog::updateAddRemoveEntry() QStringList versionTokens = QApplication::applicationVersion().split('.'); settings.setValue("DisplayVersion", QApplication::applicationVersion()); - settings.setValue("EstimatedSize", getDirectorySize(config->getInstallationDirectory())); + settings.setValue("EstimatedSize", getDirectorySize(config->getInstallationDirectory(), true)); settings.setValue("MajorVersion", versionTokens[0].toInt()); settings.setValue("MinorVersion", versionTokens[1].toInt()); #endif diff --git a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp index a527e680a..94ea973e6 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp @@ -243,7 +243,7 @@ void CUninstallDialog::updateSizes() { const CServer &server = config->getServer(it.key()); - qint64 bytes = getDirectorySize(server.getDirectory()); + qint64 bytes = getDirectorySize(server.getDirectory(), true); emit updateSize(it.value(), qBytesToHumanReadable(bytes)); @@ -257,7 +257,7 @@ void CUninstallDialog::updateSizes() { const CProfile &profile = config->getProfile(it.key()); - qint64 bytes = getDirectorySize(profile.getDirectory()); + qint64 bytes = getDirectorySize(profile.getDirectory(), true); emit updateSize(it.value(), qBytesToHumanReadable(bytes)); diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.h b/code/ryzom/tools/client/ryzom_installer/src/utils.h index 363c30b9e..6de89bcba 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.h +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.h @@ -30,7 +30,7 @@ QString qBytesToHumanReadable(qint64 bytes); -qint64 getDirectorySize(const QString &directory); +qint64 getDirectorySize(const QString &directory, bool recursize); // Convert a UTF-8 string to QString QString qFromUtf8(const std::string &str);