From 2340c8ff20fda7dc1d1952ed42c960f8cca4b256 Mon Sep 17 00:00:00 2001 From: felisucoibi Date: Sun, 1 Dec 2019 12:28:07 +0100 Subject: [PATCH 1/4] Update misc.cpp --- retroshare-gui/src/util/misc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/util/misc.cpp b/retroshare-gui/src/util/misc.cpp index adb422a4c..45b9ef41a 100644 --- a/retroshare-gui/src/util/misc.cpp +++ b/retroshare-gui/src/util/misc.cpp @@ -38,7 +38,7 @@ QString misc::friendlyUnit(float val) if(val < 0) { return tr("Unknown", "Unknown (size)"); } - const QString units[5] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)") }; + const QString units[6] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)"), tr(" PB", "petabytes (1024 terabytes)") }; for(unsigned int i=0; i<5; ++i) { if (val < 1024.) { return QString(QByteArray::number(val, 'f', 1)) + units[i]; From ff9c7774f27978d91e626926ae90d0fb85230a0f Mon Sep 17 00:00:00 2001 From: felisucoibi Date: Sun, 1 Dec 2019 12:28:52 +0100 Subject: [PATCH 2/4] Update hash_cache.cc --- libretroshare/src/file_sharing/hash_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/file_sharing/hash_cache.cc b/libretroshare/src/file_sharing/hash_cache.cc index 340391f03..cdc675c10 100644 --- a/libretroshare/src/file_sharing/hash_cache.cc +++ b/libretroshare/src/file_sharing/hash_cache.cc @@ -69,7 +69,7 @@ bool HashStorage::hashingProcessPaused() static std::string friendlyUnit(uint64_t val) { - const std::string units[5] = {"B","KB","MB","GB","TB"}; + const std::string units[6] = {"B","KB","MB","GB","TB","PB"}; char buf[50] ; double fact = 1.0 ; From c9aab51c7ce1d35ddff0d12b5db050230859b62f Mon Sep 17 00:00:00 2001 From: felisucoibi Date: Sun, 1 Dec 2019 23:01:20 +0100 Subject: [PATCH 3/4] Update hash_cache.cc --- libretroshare/src/file_sharing/hash_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/file_sharing/hash_cache.cc b/libretroshare/src/file_sharing/hash_cache.cc index cdc675c10..22955ae9d 100644 --- a/libretroshare/src/file_sharing/hash_cache.cc +++ b/libretroshare/src/file_sharing/hash_cache.cc @@ -74,7 +74,7 @@ static std::string friendlyUnit(uint64_t val) double fact = 1.0 ; - for(unsigned int i=0; i<5; ++i) + for(unsigned int i=0; i<6; ++i) if(double(val)/fact < 1024.0) { sprintf(buf,"%2.2f",double(val)/fact) ; From b709e68c72e5ff4abfdc43767924d8b922b2ba03 Mon Sep 17 00:00:00 2001 From: felisucoibi Date: Mon, 2 Dec 2019 11:00:35 +0100 Subject: [PATCH 4/4] Update misc.cpp --- retroshare-gui/src/util/misc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/util/misc.cpp b/retroshare-gui/src/util/misc.cpp index 45b9ef41a..a66de053c 100644 --- a/retroshare-gui/src/util/misc.cpp +++ b/retroshare-gui/src/util/misc.cpp @@ -39,7 +39,7 @@ QString misc::friendlyUnit(float val) return tr("Unknown", "Unknown (size)"); } const QString units[6] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)"), tr(" PB", "petabytes (1024 terabytes)") }; - for(unsigned int i=0; i<5; ++i) { + for(unsigned int i=0; i<6; ++i) { if (val < 1024.) { return QString(QByteArray::number(val, 'f', 1)) + units[i]; }