summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-mobile/qmlmanager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 6a38078a8..048e787cf 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -36,14 +36,19 @@ extern "C" int gitProgressCB(int percent, const char *text)
{
static QElapsedTimer timer;
static qint64 lastTime = 0;
+ static int lastPercent = -100;
if (!timer.isValid() || percent == 0) {
timer.restart();
lastTime = 0;
+ lastPercent = -100;
}
QMLManager *self = QMLManager::instance();
if (self) {
qint64 elapsed = timer.elapsed();
+ // don't show the same status twice in 200ms
+ if (percent == lastPercent && elapsed - lastTime < 200)
+ return 0;
self->loadDiveProgress(percent);
QString logText = QString::number(elapsed / 1000.0, 'f', 1) + " / " + QString::number((elapsed - lastTime) / 1000.0, 'f', 3) +
QString(" : git progress %1 (%2)").arg(percent).arg(text);