Adapt code to new crop terminology too
ClosedPublic

Authored by rkflx on Mar 22 2018, 10:33 PM.

Details

Summary

D11578 changes UI strings from "Restrict to image ratio" to
"Preserve aspect ratio". Here we adapt the naming of functions and
config variables too, to lessen developer confusion.

Test Plan

Compile, grep for "restrict"

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkflx requested review of this revision.Mar 22 2018, 10:33 PM
rkflx created this revision.
huoni accepted this revision as: huoni.Mar 22 2018, 10:41 PM

Good stuff, doesn't break anything for me.

There are still a few mentions of "restricted" or "unrestricted" in some comments, but that's probably fine.

E.g. in CropWidget::updateCropRatio and CropTool::mouseMoveEvent

This revision is now accepted and ready to land.Mar 22 2018, 10:41 PM

In general I'm not a huge fan of lengthy variable names that precisely mirror their user-visible strings, for precisely this reason. IMHO we should aspire to have our variable names communicate their meaning adequately such that we don't need to rename variables every time we change strings.

rkflx added a comment.EditedMar 22 2018, 10:49 PM

There are still a few mentions of "restricted" or "unrestricted" in some comments, but that's probably fine.

Yes, I think those are legitimate and do not pertain to the checkbox.

In general I'm not a huge fan of lengthy variable names that precisely mirror their user-visible strings, for precisely this reason. IMHO we should aspire to have our variable names communicate their meaning adequately such that we don't need to rename variables every time we change strings.

True in general, but sometimes both UI and code string are the same when trying to make them sound "right" each. Any ideas for something more generic which still makes it clear what this belongs to?

In general I'm not a huge fan of lengthy variable names that precisely mirror their user-visible strings, for precisely this reason. IMHO we should aspire to have our variable names communicate their meaning adequately such that we don't need to rename variables every time we change strings.

I see your point, but it's a big help to someone unfamiliar with the code. It instantly communicates that X variable corresponds to X GUI element.

This revision was automatically updated to reflect the committed changes.