Reduce spurious signal emissions
ClosedPublic

Authored by apol on Nov 14 2017, 2:15 AM.

Details

Summary

We were reporting that the margins were changing whenever anything changed
in a FrameSvg, this patch makes sure we are only reporting the changes
when it actually changes.
This also fixes a binding loop in Desktop.qml from plasma-desktop.

BUG: 382233

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.
apol created this revision.Nov 14 2017, 2:15 AM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptNov 14 2017, 2:15 AM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
apol edited the summary of this revision. (Show Details)Nov 14 2017, 2:29 AM

Good idea with the RAII class.

If we're doing some caching in there now anyway, can we perhaps add individual signals for the margins or is it not worth it?

apol added a comment.Nov 14 2017, 12:29 PM

If we're doing some caching in there now anyway, can we perhaps add individual signals for the margins or is it not worth it?

No, we don't have any caching. Also they never seem to change, on my system it goes from 0 (default) to 6 for all of them (whatever is in my theme I guess) and it stays like that. I wouldn't worry about separate signals.

davidedmundson accepted this revision.Nov 16 2017, 2:56 PM
davidedmundson added inline comments.
src/declarativeimports/core/framesvgitem.cpp
295

If we always have 4 and can initialised them to 0 qreal[4] with a c style array would be better.

This revision is now accepted and ready to land.Nov 16 2017, 2:56 PM
apol added inline comments.Nov 16 2017, 3:20 PM
src/declarativeimports/core/framesvgitem.cpp
295

Would it? it's harder to compare then as you can't do a simple !=

This revision was automatically updated to reflect the committed changes.