Convert enumeration MyMoneyReport::EColumnType into a class to be more type safe
ClosedPublic

Authored by habacker on Mar 5 2018, 7:18 AM.

Details

Summary

Type safety is increased by moving the enum into a separate name space (here
a class is used because namespaces are not allowed inside classes).

Q_ENUM(s) or QFlags could also not be used because the related enums need
to be defined somewhere outside, which does not solve the issue having all
constants in MyMoneyReport namespace.

CCBUG:391091

Test Plan

compiled on linux

Diff Detail

Repository
R261 KMyMoney
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
habacker requested review of this revision.Mar 5 2018, 7:18 AM
habacker created this revision.
habacker updated this revision to Diff 28695.Mar 5 2018, 12:02 PM
  • Use sub class instead of unusable QFlags
  • Extended commit message
habacker edited the summary of this revision. (Show Details)Mar 5 2018, 12:03 PM
habacker updated this revision to Diff 28784.Mar 6 2018, 7:35 AM
habacker retitled this revision from Make enumeration EColumnType in class MyMoney Report type safe by converting to a class to Convert enumeration MyMoneyReport::EColumnType into a class to be more type safe.
habacker edited the summary of this revision. (Show Details)
  • updated commit message

Please accept this patch, because the patches from D11053 and D11058, which has been accepted, depends on this.

tbaumgart accepted this revision.Mar 7 2018, 9:34 AM
This revision is now accepted and ready to land.Mar 7 2018, 9:34 AM
This revision was automatically updated to reflect the committed changes.