From f16a3a1709be50cb2ed4f4ca0e1e9bb5217cc25f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 5 Apr 2016 21:16:25 -0700 Subject: Keep the instance in static variable Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 0bfde62aa..cbd184539 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -37,13 +37,16 @@ extern "C" int gitProgressCB(int percent, const char *text) static QElapsedTimer timer; static qint64 lastTime = 0; static int lastPercent = -100; + static QMLManager *self; + + if (!self) + self = QMLManager::instance(); if (!timer.isValid() || percent == 0) { timer.restart(); lastTime = 0; lastPercent = -100; } - QMLManager *self = QMLManager::instance(); if (self) { qint64 elapsed = timer.elapsed(); // don't show the same status twice in 200ms -- cgit v1.2.3-70-g09d2