Style fixes.

This commit is contained in:
Martin Rotter 2015-02-09 15:43:18 +01:00
parent 2a3347ccbf
commit 867124ffd8

View file

@ -659,8 +659,7 @@ QString DownloadManager::downloadDirectory() {
return m_downloadDirectory; return m_downloadDirectory;
} }
QString DownloadManager::timeString(double time_remaining) QString DownloadManager::timeString(double time_remaining) {
{
QString remaining; QString remaining;
if (time_remaining > 60) { if (time_remaining > 60) {
@ -676,21 +675,23 @@ QString DownloadManager::timeString(double time_remaining)
return remaining; return remaining;
} }
QString DownloadManager::dataString(qint64 size) QString DownloadManager::dataString(qint64 size) {
{
QString unit; QString unit;
double newSize; double newSize;
if (size < 1024) { if (size < 1024) {
newSize = size; newSize = size;
unit = tr("bytes"); unit = tr("bytes");
} else if (size < 1024 * 1024) { }
else if (size < 1024 * 1024) {
newSize = (double)size / (double)1024; newSize = (double)size / (double)1024;
unit = tr("kB"); unit = tr("kB");
} else if (size < 1024 * 1024 * 1024) { }
else if (size < 1024 * 1024 * 1024) {
newSize = (double)size / (double)(1024 * 1024); newSize = (double)size / (double)(1024 * 1024);
unit = tr("MB"); unit = tr("MB");
} else { }
else {
newSize = (double)size / (double)(1024 * 1024 * 1024); newSize = (double)size / (double)(1024 * 1024 * 1024);
unit = tr("GB"); unit = tr("GB");
} }