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>
This commit is contained in:
Dirk Hohndel 2016-04-05 23:01:16 -07:00
parent 922c945f5a
commit 6725d54db2

View file

@ -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;
}