summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-18 01:46:49 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-18 01:46:49 -0700
commit6afe6baa1413fc74412362cab2393a77b9a9d49a (patch)
tree649531af8829fe87bf2a4143281a8f89f1e0ddf9 /desktop-widgets/mainwindow.cpp
parent2b01ab7d505b55812d656f6ce19ed19965d7c90f (diff)
downloadsubsurface-6afe6baa1413fc74412362cab2393a77b9a9d49a.tar.gz
Desktop UI: reset cloud storage progress 'percentage'
The fake percentage needs to at least start at 0 for every cloud interaction. Yes, the file global variable is ugly. So sue me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index c8eaecaa2..4753f178c 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -66,16 +66,17 @@
QProgressDialog *progressDialog = NULL;
bool progressDialogCanceled = false;
+static int progressCounter = 0;
+
extern "C" int updateProgress(const char *text)
{
- static int progress = 0;
if (verbose)
qDebug() << "git storage:" << text;
if (progressDialog) {
progressDialog->setLabelText(text);
- progressDialog->setValue(++progress);
- if (progress == 100)
- progress = 0; // yes this is silly, but we really don't know how long it will take
+ progressDialog->setValue(++progressCounter);
+ if (progressCounter == 100)
+ progressCounter = 0; // yes this is silly, but we really don't know how long it will take
}
qApp->processEvents();
return progressDialogCanceled;
@@ -2018,6 +2019,7 @@ void MainWindow::showProgressBar()
progressDialog->setWindowModality(Qt::WindowModal);
progressDialog->setMinimumDuration(0);
progressDialogCanceled = false;
+ progressCounter = 0;
connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelCloudStorageOperation()));
}