diff --git a/cuttlefish/src/main.cpp b/cuttlefish/src/main.cpp --- a/cuttlefish/src/main.cpp +++ b/cuttlefish/src/main.cpp @@ -119,14 +119,15 @@ return -1; } - engine.load(QUrl::fromLocalFile(package.filePath("mainscript"))); - if (engine.rootObjects().isEmpty()) - return -1; - auto iconModel = new CuttleFish::IconModel(engine.rootContext()); engine.rootContext()->setContextProperty("iconModel", iconModel); engine.rootContext()->setContextProperty("pickerMode", parser.isSet("picker")); + engine.load(QUrl::fromLocalFile(package.filePath("mainscript"))); + if (engine.rootObjects().isEmpty()) { + return -1; + } + #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) qmlRegisterType(); #else