[Image Wallpaper] Simplify width/height management
ClosedPublic

Authored by broulik on Jan 7 2017, 1:44 PM.

Details

Summary

Directly expose "targetSize" as property. The wallpaper is already initialized with the correct size for some time now but the fact that we had two properties width and height in there had it still do unneccessary work when it emitted "sizeChanged(2560, 0)" and then the final "sizeChanged(2560, 1440)" afterwards.

Also, I didn't really see a point in storing the wallpaper size in its config, it's overwritten by the wallpaper anyway and only used in the wallpaper config dialog for the aspect ratio. We can just ask the view directly then.

BUG: 374689
FIXED-IN: 5.9.0

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik updated this revision to Diff 9817.Jan 7 2017, 1:44 PM
broulik retitled this revision from to [Image Wallpaper] Simplify width/height management.
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 R120 Plasma Workspace.
Restricted Application added a project: Plasma. · View Herald TranscriptJan 7 2017, 1:44 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Cool, proper event compression, I'm a fan
Two comments, then ship it.

wallpapers/image/image.cpp
235

I think this needs moving out of this block that says
if (m_mode == SingleImage)

Slideshow will still uses this binding.

wallpapers/image/imagepackage/contents/ui/config.qml
50

we can be improve that I think

configview exports the containment's graphic item as an attached property.

Qt.size(plasmoid.width, plasmoid.height)

This means PMC/Plasmoidviewer will still work correclty.

(tested just now)

broulik updated this revision to Diff 9824.Jan 7 2017, 8:55 PM
broulik marked an inline comment as done.
  • Use magic plasmoid.width/plasmoid.height
  • Emit change whenever property changes, ie. move outside of single image if statement
  • Drop now unused width/height also from slideshow package config
broulik updated this revision to Diff 9825.Jan 7 2017, 8:56 PM
  • Remove now unused m_size member, we just use m_targetSize
broulik updated this object.Jan 7 2017, 8:59 PM
broulik edited the test plan for this revision. (Show Details)
davidedmundson accepted this revision.Jan 8 2017, 1:42 PM
davidedmundson added a reviewer: davidedmundson.
This revision is now accepted and ready to land.Jan 8 2017, 1:42 PM
This revision was automatically updated to reflect the committed changes.