From 6725d54db2a1793c3483385daffd6be8acc6a3b9 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 5 Apr 2016 23:01:16 -0700 Subject: Desktop UI: make sure that git progress is actually shown This updates the got progress indicator to the changed interface where we don't pass in an explicit percentage. It also finally fixes an old problem: If we don't allow the Qt main loop to process the events, we'll never see a decent progress indicator... Signed-off-by: Dirk Hohndel --- desktop-widgets/mainwindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'desktop-widgets/mainwindow.cpp') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index c6f487486..a86901f98 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -66,12 +66,17 @@ QProgressDialog *progressDialog = NULL; bool progressDialogCanceled = false; -extern "C" int updateProgress(int percent, const char *text) +extern "C" int updateProgress(bool reset, const char *text) { + static int percent; + + if (reset) + percent = 0; if (verbose) - qDebug() << "git storage:" << percent << "% with note" << text; + qDebug() << "git storage:" << +percent << "% (" << text << ")"; if (progressDialog) progressDialog->setValue(percent); + qApp->processEvents(); return progressDialogCanceled; } -- cgit v1.2.3-70-g09d2