Especially since the Theme isn't modified in any way but just used to read some data.
While the Private part of Theme is already shared, creating a Theme instance still has some setup cost.
Details
Details
- Reviewers
mart - Group Reviewers
Plasma - Commits
- R242:eac69e04690b: Share Plasma::Theme instances between multiple ColorScope
Noticed in GammaRay there was a tonne of Theme objects.
Changing themes and changing color schemes still works.
Now get ~400 Theme objects created rather than well over a thousand
Diff Detail
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
Now in multi-thread environment will have problems especially on actualTheme(), no?
ColorScope is QML-only and should be fine? Not sure about Svg, it never mentioned being thread-safe.
src/declarativeimports/core/colorscope.h | ||
---|---|---|
135 | How about using a QSharedPointer? |
src/declarativeimports/core/colorscope.h | ||
---|---|---|
135 | Complained with "QSharedPointer: cannot create a QSharedPointer from a QObject-tracking QWeakPointer" |
src/declarativeimports/core/colorscope.h | ||
---|---|---|
135 | Seems odd. |