Refactor MyMoneyFile
ClosedPublic

Authored by wojnilowicz on Nov 27 2017, 6:05 PM.

Details

Summary

Fix check for inline methods in public classes
Fix check for methods that return 'const' refs in public classes

Test Plan

All tests pass. Changed name of an account.

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.
wojnilowicz requested review of this revision.Nov 27 2017, 6:05 PM
wojnilowicz created this revision.
wojnilowicz updated this revision to Diff 23223.Dec 1 2017, 4:25 PM

Fixed some returns of addresses to temporary objects.

tbaumgart requested changes to this revision.Dec 1 2017, 5:35 PM
tbaumgart added a subscriber: tbaumgart.

Other than the stuff I have commented, it compiles fine and completes tests.

kmymoney/mymoney/mymoneyfile.h
721

You need to change

const MyMoneyAccount& MyMoneyQifReader::findAccount(const MyMoneyAccount& acc, const MyMoneyAccount& parent) const

into

MyMoneyAccount MyMoneyQifReader::findAccount(const MyMoneyAccount& acc, const MyMoneyAccount& parent) const

and change

const MyMoneyAccount& existingAccount = file->subAccountByName(parentAccount, name);

to

const MyMoneyAccount existingAccount = file->subAccountByName(parentAccount, name);

in that method (around line 894).

Also, there is another signature that needs to be updated. The method

const MyMoneyAccount& KBankingPlugin::account(const QString& key, const QString& value) const

should be converted to

MyMoneyAccount KBankingPlugin::account(const QString& key, const QString& value) const
This revision now requires changes to proceed.Dec 1 2017, 5:35 PM
This revision was automatically updated to reflect the committed changes.