[Panel] Fix warning and don't cause side-effects in binding
ClosedPublic

Authored by broulik on Jun 13 2016, 9:06 AM.

Details

Summary

The length binding was assigning a value to the length property during the property evaluation.
Also, containment might be null which was never checked for causing a runtime warning.

Test Plan

Added vertical panel, centered it, put task manager in there, panel would still automatically shrink and grow depending on the number of windows shown

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik updated this revision to Diff 4379.Jun 13 2016, 9:06 AM
broulik retitled this revision from to [Panel] Fix warning and don't cause side-effects in binding.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: Plasma.
broulik set the repository for this revision to R119 Plasma Desktop.
Restricted Application added a project: Plasma. · View Herald TranscriptJun 13 2016, 9:06 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik updated this revision to Diff 4386.Jun 13 2016, 10:59 AM

Use "when" to not mess with the panel length until we have a containment.

Otherwise we would start and briefly have the panel at 0 size which looks ugly. This probably was concealed by the old code just throwing an exception when it tried to access formFactor on null containment

mart accepted this revision.Jun 13 2016, 6:41 PM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Jun 13 2016, 6:41 PM
This revision was automatically updated to reflect the committed changes.