diff options
| author | Victor Tran <vicr12345@gmail.com> | 2018-07-13 22:47:55 +1000 |
|---|---|---|
| committer | Victor Tran <vicr12345@gmail.com> | 2018-07-13 22:47:55 +1000 |
| commit | 14f04e63ebf45d5896effe36b55470d86f735dfb (patch) | |
| tree | ce9ac6deba28917288ccf8d2ed494253d4c9af02 /installer/main.cpp | |
| parent | a1e9542350cc617412781af88d5b33133d4be8f4 (diff) | |
| download | theInstaller-14f04e63ebf45d5896effe36b55470d86f735dfb.tar.gz theInstaller-14f04e63ebf45d5896effe36b55470d86f735dfb.tar.bz2 theInstaller-14f04e63ebf45d5896effe36b55470d86f735dfb.zip | |
Download progress and process checking for uninstall
Diffstat (limited to 'installer/main.cpp')
| -rw-r--r-- | installer/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/installer/main.cpp b/installer/main.cpp index ec07db9..8059acf 100644 --- a/installer/main.cpp +++ b/installer/main.cpp @@ -65,3 +65,18 @@ int main(int argc, char *argv[]) return a.exec(); } + +QString calculateSize(quint64 size) { + QString ret; + if (size > 1073741824) { + ret = QString::number(((float) size / 1024 / 1024 / 1024), 'f', 2).append(" GiB"); + } else if (size > 1048576) { + ret = QString::number(((float) size / 1024 / 1024), 'f', 2).append(" MiB"); + } else if (size > 1024) { + ret = QString::number(((float) size / 1024), 'f', 2).append(" KiB"); + } else { + ret = QString::number((float) size, 'f', 2).append(" B"); + } + + return ret; +} |
