Skip to content

Commit

Permalink
Merge #22: Check whether initerrormessage.qml is loaded correctly
Browse files Browse the repository at this point in the history
15b7c5a qml: Check whether initerrormessage.qml is loaded correctly (Hennadii Stepanov)

Pull request description:

  If `QQmlApplicationEngine::load()` fails calling `qGuiApp->exec()` must be avoided.

ACKs for top commit:
  jarolrod:
    ACK 15b7c5a

Tree-SHA512: 5e9a319b6de270cacf654e8de2e65850e749960b152a8a2bf134d0c2e66af5997916ea51ad9a817c2a4215de0f95da20a68eb2647de41b256a52477fa227a447
  • Loading branch information
hebasto committed Aug 27, 2021
2 parents ffa9045 + 15b7c5a commit d0c5397
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/qml/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ bool InitErrorMessageBox(
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("message", QString::fromStdString(message.translated));
engine.load(QUrl(QStringLiteral("qrc:///qml/pages/initerrormessage.qml")));
if (engine.rootObjects().isEmpty()) {
return EXIT_FAILURE;
}
qGuiApp->exec();
return false;
}
Expand Down

0 comments on commit d0c5397

Please sign in to comment.