Avoid using plasmoid.rootItem in SystemTray's ConfigEntries.qml.
BUG: 393630
ngraham | |
broulik | |
davidedmundson | |
anthonyfieroni | |
fvogt |
Plasma |
Avoid using plasmoid.rootItem in SystemTray's ConfigEntries.qml.
BUG: 393630
Lint Skipped |
Unit Tests Skipped |
I notice that something with model goes wrong. I've try to fix it in D18249 but unfortunately I don't see problem in.
If the only usage is the SNI model lets just rebuild the model on the ConfigEntries side.
You're right that sharing objects between contexts seems to cause issues.
It's backed by a datasource so all the heavy operations are already implicitly shared.
We should only need
PlasmaCore.DataSource { id: statusNotifierSource engine: "statusnotifieritem" interval: 0 onSourceAdded: { connectSource(source) } Component.onCompleted: { connectedSources = sources } } PlasmaCore.SortFilterModel { id: statusNotifierModel sourceModel: PlasmaCore.DataModel { dataSource: statusNotifierSource } }
and then port all the plasmoid.rootItem to just our local statusNotifierModel
@davidedmundson it works. I really don't know that sharing model between contexts cause a such behavior. It's caused by some ref counting ? Did you know why, it's internal Qt issue that we can fix or it's expected ?
I really don't know that sharing model between contexts cause a such behavior.
Sorry, I used the wrong word. Sharing contexts is fine. Sharing across engines is problematic.
QQmlData is shared between engines, but the relevant QObjectWrapper is
not. Since 749a7212e903d8e8c6f256edb1836b9449cc7fe1 when a
QObjectWrapper is deleted it resets the shared QQmlData propertyCache.
Any code path on the first engine that use the propertycache need to rebuild it
(In an ideal world we wouldn't have 2 engines, but that's a whole different topic)
Use @davidedmundson 's approach.
@ngraham Could you please help me to discard D18804 ? This patch does not require it anymore.
And land it.
Thanks everyone !