mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
922c945f5a
commit
6725d54db2
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue