Commit 81e16741 authored by Marco Martin's avatar Marco Martin
Browse files

quit gracefully on sidebar QML errors

It shouldn't crash, but display exactly what the error was with its qml
BUG:394902
parent 00732b70
......@@ -481,6 +481,12 @@ void SidebarMode::initWidget()
d->quickWidget->setSource(QUrl::fromLocalFile(d->package.filePath("mainscript")));
if (!d->quickWidget->rootObject()) {
for (const auto &err : d->quickWidget->errors()) {
qWarning() << err.toString();
}
qFatal("Fatal error while loading the sidebar view qml component");
}
const int rootImplicitWidth = d->quickWidget->rootObject()->property("implicitWidth").toInt();
if (rootImplicitWidth != 0) {
d->quickWidget->setFixedWidth(rootImplicitWidth);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment