summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-05 23:01:16 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-05 23:43:17 -0700
commit6725d54db2a1793c3483385daffd6be8acc6a3b9 (patch)
treee9f7c2ffbe7e6a3bf97050b177c21d82d0ab654a /desktop-widgets
parent922c945f5a5199fb27f9b68272157a238d2c371e (diff)
downloadsubsurface-6725d54db2a1793c3483385daffd6be8acc6a3b9.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp9
1 files changed, 7 insertions, 2 deletions
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;
}