Skip to content
Commit a26aff4a authored by ivan tkachenko's avatar ivan tkachenko 🗯 Committed by Alexander Lohnau
Browse files

SharedQmlEngine: Improve error reporting when loading main component

Initial page component follows somewhat more complicated rules. Not only
it has a QQmlComponent that may fail to load, but it has also
QQmlIncubator which may fail to instantiate an otherwise valid and
loaded component. For example, the incubator may fail if KCM's main.qml
top-level component has required properties.

SharedQmlEngine::status implementation was some weird algorithm, and the
actual status is not what the only consumer is interested in, so I got
rid of it in favor of isError/errorString pair.

As a drive-by cleanup, component and incubator's `status()` comparisons
were replaced with dedicated named predicates like isReady & isError.

Test plan: mess up some KCM implementation. For example, in flatpak-kcm
put a `required property bool hello` line in main.qml. KCM shell should
fail to load KCM as a whole, and display a standard error KCM instead
with an error text about uninitialized required property (and the same
error should be printed to the console output). Then revert main.qml,
and put that line in permissions.qml instead (which is a second page).
Now the KCM should load the first page, but the same formatted error
should be printed to the console about the second page.
parent 7a9e3ee5
Pipeline #634832 passed with stage
in 2 minutes and 12 seconds
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