At the moment whenever something changed we were emitting colorGroupChanged
and then every color would recompute. This would end up being emitted
over 10 times at plasma startup so far.
This patch makes sure that the property will only be emitted if the color
group actually changes.
Details
- Reviewers
mart davidedmundson - Group Reviewers
Plasma - Commits
- R242:f8047e86b298: Reduce the amount of spurious property changes on ColorScope
Ran plasma, didn't notice issues.
I don't see all of the changes on the property anymore
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.
Concept is good.
src/declarativeimports/core/colorscope.cpp | ||
---|---|---|
135 | It's weird to be caching in a public getter. It opens us up for problems If some client code (for whatever reason) did then our signals in checkColorGroupChanged won't get emitted. Can we move this member var into checkColorGroupChanged? Means we can get rid of the mutable too |
description needs updating with the new benefits (saving lookups every time)
src/declarativeimports/core/colorscope.cpp | ||
---|---|---|
192–193 | check here. |
src/declarativeimports/core/colorscope.cpp | ||
---|---|---|
192–193 | this is when the item changes window and we're not sure we are still in the same color set, so i think is ok to keep this signal |
src/declarativeimports/core/colorscope.cpp | ||
---|---|---|
192–193 | yeah, my point was we may /also/ need the colorsChanged signal (via checkColorGroupChanged) |
src/declarativeimports/core/colorscope.h | ||
---|---|---|
131 | valgrind says this member isn't initialized, please fix. |