Removes preferred definition so a new wallpaper is selected.

Authored by antlarr on Oct 7 2016, 4:37 PM.



Removes preferred definition so a new wallpaper is selected.
Also, just in case, check for division by 0.

When the screen resolution changes, a new wallpaper has to be chosen
but this is not happening unless we remove the preferred definition.

This depends on to be accepted.

Test Plan

I ran plasmashell with the default opensuse wallpaper (a green bulb)
while changing the screen resolution between 1024x768 and 1280x720.

With this and the kpackage patch above, a different background image is
selected correctly with the correct aspect ratio.

Diff Detail

R120 Plasma Workspace
No Linters Available
No Unit Test Coverage
antlarr updated this revision to Diff 7204.Oct 7 2016, 4:37 PM
antlarr retitled this revision from to Removes preferred definition so a new wallpaper is selected..
antlarr updated this object.
antlarr edited the test plan for this revision. (Show Details)
antlarr added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 7 2016, 4:37 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart added a subscriber: mart.Oct 10 2016, 11:38 AM
mart added inline comments.

shouldn't then "preferred" just not be defined anymore in the wallpaper package structure then?

antlarr added inline comments.Oct 11 2016, 6:48 AM

Sorry, I don't get your comment. That's why I remove it, so that "preferred" is not defined anymore and the next call to Image::findPreferedImageInPackage doesn't have a "preferred" wallpaper so a new one is chosen that respects the new aspect ratio for the new m_targetSize value.
Note that the first line in findPreferedImageInPackage is:
if (!package.filePath("preferred").isEmpty()) return;

mart accepted this revision.Oct 20 2016, 9:29 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Oct 20 2016, 9:29 AM
antlarr closed this revision.Oct 20 2016, 11:52 AM