mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Keep the instance in static variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f869ce51b4
commit
f16a3a1709
1 changed files with 4 additions and 1 deletions
|
@ -37,13 +37,16 @@ extern "C" int gitProgressCB(int percent, const char *text)
|
||||||
static QElapsedTimer timer;
|
static QElapsedTimer timer;
|
||||||
static qint64 lastTime = 0;
|
static qint64 lastTime = 0;
|
||||||
static int lastPercent = -100;
|
static int lastPercent = -100;
|
||||||
|
static QMLManager *self;
|
||||||
|
|
||||||
|
if (!self)
|
||||||
|
self = QMLManager::instance();
|
||||||
|
|
||||||
if (!timer.isValid() || percent == 0) {
|
if (!timer.isValid() || percent == 0) {
|
||||||
timer.restart();
|
timer.restart();
|
||||||
lastTime = 0;
|
lastTime = 0;
|
||||||
lastPercent = -100;
|
lastPercent = -100;
|
||||||
}
|
}
|
||||||
QMLManager *self = QMLManager::instance();
|
|
||||||
if (self) {
|
if (self) {
|
||||||
qint64 elapsed = timer.elapsed();
|
qint64 elapsed = timer.elapsed();
|
||||||
// don't show the same status twice in 200ms
|
// don't show the same status twice in 200ms
|
||||||
|
|
Loading…
Reference in a new issue