Skip to content
Verified Commit 302fed0a authored by ivan tkachenko's avatar ivan tkachenko 🗯
Browse files

applets/notes: Move DocumentHandler inside full representation

PlasmoidItem's setting `preloadFullRepresentation: true` causes a glitch
of initialization order: full representation component is created
immediately when the toggle is flipped ON, which is practically right
in the middle on QML Engine being busy creating PlasmoidItem as a whole
and populating its properties and bindings. Essentially there is a risk
of observing something normally unobservable: QML objects' id references
may be null on read! So the signal handler onCfgFontPointSizeChanged in
TextArea was failing on start with an error

main.qml:214: TypeError: Value is null and could not be converted to an object

which can be interpreted as "I know that `documentHandler` is an object
property, it exists and I can try to read it, but currently its value
is null". That definitely is not something that's supposed to ever
happen in QML land, but something that can be easily patched up in
applet. Besides, there is no reason why DocumentHandler should exist
outside of full representation component, and relocation simplifies its
bindings by getting rid of conditionals (which theoretically were not
needed anyway due to preloading in the first place).
parent 7ef1e785
Pipeline #493540 passed with stage
in 4 minutes and 16 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