Simplify signal handling between engine and models
ClosedPublic

Authored by tbaumgart on Jun 13 2018, 4:19 PM.

Details

Summary

Make the signal connection and disconnection more readable

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.
tbaumgart requested review of this revision.Jun 13 2018, 4:19 PM
tbaumgart created this revision.
wojnilowicz accepted this revision.Jun 16 2018, 11:47 AM

Beside trhee comments, it looks good to me.

kmymoney/kmymoney.cpp
465–502

Do you need to see that "file" is of MyMoneyFile kind?
If not, then I would write

const auto file = MyMoneyFile::instance();
467

Why not?

const auto accountsModel = file->accountsModel();
508

Same here, i.e

q->disconnect(file, nullptr, file->accountsModel(), nullptr);
This revision is now accepted and ready to land.Jun 16 2018, 11:47 AM
tbaumgart marked 3 inline comments as done.Jun 16 2018, 2:17 PM

I will make the requested changes and commit. I still have to get used to auto :-)

kmymoney/kmymoney.cpp
508

Nope, that won't work. MyMoneyFile::instance() != Models::instance()

This revision was automatically updated to reflect the committed changes.
tbaumgart marked an inline comment as done.