Fix Crop tool Aspect ratio sometimes randomly preselected

Authored by muhlenpfordt on Aug 21 2018, 8:59 AM.



If CropAdvanced settingsAspect ratio is not set to any of
the predefined values the CropRatioIndex config value is not
initialized when starting Crop. This sometimes leads to a
wrong preselection of a random ratio.
This patch initializes the internal index variable.

FIXED-IN: 18.08.1

Test Plan
  • Open Crop with empty Aspect ratio setting
  • Restart Gwenview / Crop multiple times
  • Check that Aspect ratio is not randomly preselected
  • Check that a selected Aspect ratio is (re-)stored correctly
  • Check that gwenviewrc does not store any random CropRatioIndex

Diff Detail

R260 Gwenview
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
muhlenpfordt created this revision.Aug 21 2018, 8:59 AM
Restricted Application added a project: Gwenview. · View Herald TranscriptAug 21 2018, 8:59 AM
muhlenpfordt requested review of this revision.Aug 21 2018, 8:59 AM
rkflx accepted this revision.Aug 21 2018, 7:13 PM
rkflx added a subscriber: rkflx.

I was not able to reproduce showing a wrong ratio in the checkbox, but CropRatioIndex=39816368 in gwenviewrc is certainly not correct ;)

Patch LGTM.

This revision is now accepted and ready to land.Aug 21 2018, 7:13 PM
This revision was automatically updated to reflect the committed changes.