]> gitweb.hamatoma.de Git - reqt/commitdiff
rebackgui status message
authorHamatoma <git.tortouse@hm.f-r-e-i.de>
Wed, 3 Feb 2016 07:31:00 +0000 (08:31 +0100)
committerHamatoma <git.tortouse@hm.f-r-e-i.de>
Wed, 3 Feb 2016 07:31:00 +0000 (08:31 +0100)
appl/rebackgui/BackupEngine.cpp

index 02dd33e8c367a646ebdaaa0162c35525df011cd4..27aae20addb04167981fbacefc5e3fc5e256510b 100644 (file)
@@ -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")