diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-04-05 21:16:25 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-05 21:16:25 -0700 |
commit | f16a3a1709be50cb2ed4f4ca0e1e9bb5217cc25f (patch) | |
tree | 828ccdfd69fe7e44618703c97c2a4910a507ab14 /mobile-widgets/qmlmanager.cpp | |
parent | f869ce51b473aff2818afd365013b777c3413524 (diff) | |
download | subsurface-f16a3a1709be50cb2ed4f4ca0e1e9bb5217cc25f.tar.gz |
Keep the instance in static variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 |