diff options
Diffstat (limited to 'applications')
-rw-r--r-- | applications/kube/main.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/applications/kube/main.cpp b/applications/kube/main.cpp index 2feb8dc9..6cb1f769 100644 --- a/applications/kube/main.cpp +++ b/applications/kube/main.cpp | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <QFont> | 39 | #include <QFont> |
40 | #include <QDebug> | 40 | #include <QDebug> |
41 | #include <QTimer> | 41 | #include <QTimer> |
42 | #include <QQmlContext> | ||
42 | #include <sink/store.h> | 43 | #include <sink/store.h> |
43 | 44 | ||
44 | #include "framework/src/keyring.h" | 45 | #include "framework/src/keyring.h" |
@@ -184,16 +185,20 @@ int main(int argc, char *argv[]) | |||
184 | } | 185 | } |
185 | 186 | ||
186 | { | 187 | { |
188 | QQmlContext *rootContext = nullptr; | ||
187 | bool upgradeComplete = false; | 189 | bool upgradeComplete = false; |
188 | Sink::Store::upgrade().then([&] { | 190 | Sink::Store::upgrade().then([&] (Sink::Store::UpgradeResult upgradeExecuted) { |
189 | upgradeComplete = true; | 191 | upgradeComplete = !upgradeExecuted.upgradeExecuted; |
190 | app.quit(); | 192 | if (rootContext) { |
193 | rootContext->setContextProperty("upgradeComplete", true); | ||
194 | } | ||
191 | }).exec(); | 195 | }).exec(); |
192 | if (!upgradeComplete) { | 196 | if (!upgradeComplete) { |
193 | QQmlApplicationEngine engine; | 197 | QQmlApplicationEngine engine; |
194 | const auto file = findFile("/org/kube/components/kube/upgrade.qml", engine.importPathList()); | 198 | engine.rootContext()->setContextProperty("upgradeComplete", false); |
195 | engine.load(QUrl::fromLocalFile(file)); | 199 | rootContext = engine.rootContext(); |
196 | app.exec(); | 200 | engine.load(QUrl::fromLocalFile(findFile("/org/kube/components/kube/upgrade.qml", engine.importPathList()))); |
201 | return app.exec(); | ||
197 | } | 202 | } |
198 | } | 203 | } |
199 | 204 | ||