From: Hamatoma Date: Wed, 3 Feb 2016 07:31:00 +0000 (+0100) Subject: rebackgui status message X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=3de2d4e1a68b751f5d03267a4b5ca4058011408e;p=reqt rebackgui status message --- diff --git a/appl/rebackgui/BackupEngine.cpp b/appl/rebackgui/BackupEngine.cpp index 02dd33e..27aae20 100644 --- a/appl/rebackgui/BackupEngine.cpp +++ b/appl/rebackgui/BackupEngine.cpp @@ -317,7 +317,7 @@ void BackupTask::run() node = info.mid(pos + 1); copyFile(index, relPath, node); qint64 now = QDateTime::currentMSecsSinceEpoch(); - qint64 estimated = (now - start) * m_hotBytes / max(1LL, m_processedBytes); + qint64 estimated = qint64(double(now - start) / max(1LL, m_processedBytes) * m_hotBytes); m_mainWindow->externalAppend(ReGuiQueueItem::StatusLine, NULL, tr("%1 of %2 (%3 of %4) %5 MB/sec Remaining: %6 of %7") .arg(m_processedFiles).arg(m_hotFiles) @@ -517,8 +517,7 @@ void ChecksumOfTargetTask::run() m_mutex.unlock(); now = QDateTime::currentMSecsSinceEpoch(); qint64 duration = (now - start); - qint64 estimated = qint64 ((double) duration * (double) hotBytes * 2.0 - / (double) max(1LL, processedBytes)); + qint64 estimated = estimated = qint64(double(now - start) / max(1LL, m_processedBytes) * m_hotBytes * 2); qint64 rest = estimated - duration; m_mainWindow->externalAppend(ReGuiQueueItem::StatusLine, NULL, tr("%1 of %2 (%3 of %4) %5 MB/sec Remaining: %6 of %7")