- Use QQmlParserStatus to avoid premature initialization
- Requires the days model to signal a model reset as by the time the Repeater in QML read the model for the first time it's empty (avoids boolean trap in "update" method signature by using an enum ;)
- Don't signal weeks"Model" changed if it didn't - emitting a changing variant list / json array will cause QML to destroy and re-create all delegates
Details
- Reviewers
davidedmundson - Group Reviewers
Plasma
Calendar still seems to work. Week number column still works.
Unfortunately did not result in a noticeable speedup of first invocation
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Unfortunately did not result in a noticeable speedup of first invocation
You've said this in two requests now. Whare are you using to profile?
src/declarativeimports/calendar/calendar.cpp | ||
---|---|---|
319–323 | We can simplify this: if (needsModelReset) { daysModel->setSourceData(m_daysList) } else { daysModel->update(); } No need to change DaysModel (except maybe to remove the setSourceData) check. ...or create 42 items in the ctor. Currently DaysModel has two update methods, one for changing the list, another for updates of the existing list. This is exlicitly setting it to a list of 0 items, then adding a third way of updating to handle the list being actually initialised, and one of those 3 things is clearly pointless. |