Use single inheritance for classes in dialogs
AbandonedPublic

Authored by wojnilowicz on Nov 11 2017, 10:50 AM.

Details

Summary

No header in dialogs includes non-inherited class.
No class in dialogs inherits from more than one class.

Test Plan

Tested some dialogs.

Diff Detail

Repository
R261 KMyMoney
Lint
Lint Skipped
Unit
Unit Tests Skipped
wojnilowicz created this revision.Nov 11 2017, 10:50 AM
tbaumgart requested changes to this revision.Nov 11 2017, 11:04 AM
tbaumgart added a subscriber: tbaumgart.

I get the following compile error here:

[ 28%] Building CXX object kmymoney/dialogs/CMakeFiles/dialogs.dir/investtransactioneditor.cpp.o                                                                
/home/thb/devel/kmymoney/kmymoney/dialogs/investtransactioneditor.cpp:92:24: error: 
      reference to 'Split' is ambiguous
  void activityFactory(Split::InvestmentTransactionType type)
                       ^
/home/thb/devel/kmymoney/kmymoney/dialogs/investactivities.h:46:32: note: 
      candidate found by name lookup is 'eMyMoney::Split'
namespace eMyMoney { namespace Split { enum class InvestmentTransactionType; } }
                               ^
/home/thb/devel/kmymoney/kmymoney/dialogs/investactivities.h:170:7: note: 
      candidate found by name lookup is 'Invest::Split'
class Split : public Activity
      ^
This revision now requires changes to proceed.Nov 11 2017, 11:04 AM

Please try this. It seems you've got more pedantic warning settings than I.

tbaumgart requested changes to this revision.Nov 11 2017, 11:55 AM

I get more :( I am using clang as compiler, maybe that adds to being more pedantic.

/home/thb/devel/kmymoney/kmymoney/dialogs/investtransactioneditor.cpp:751:39: error: 
      reference to 'Split' is ambiguous
    if (d->m_split.reconcileFlag() == Split::State::Unknown)
                                      ^
/home/thb/devel/kmymoney/kmymoney/dialogs/investactivities.h:46:32: note: 
      candidate found by name lookup is 'eMyMoney::Split'
namespace eMyMoney { namespace Split { enum class InvestmentTransactionType; } }
                               ^
/home/thb/devel/kmymoney/kmymoney/dialogs/investactivities.h:170:7: note: 
      candidate found by name lookup is 'Invest::Split'
class Split : public Activity
      ^

You can simply rename

class Split : public Activity

into

class StockSplit : public Activity

to avoid confusion with the transaction Split.

Also, I get the following error:

/home/thb/devel/kmymoney/kmymoney/dialogs/investtransactioneditor.cpp:347:115: error: 
      no member named 'eMyMoney' in namespace 'eMyMoney'; did you mean simply
      'eMyMoney'?
  ...this, static_cast<void (InvestTransactionEditor::*)(eMyMoney::eMyMoney::...
                                                         ^~~~~~~~~~~~~~~~~~
                                                         eMyMoney               
/home/thb/devel/kmymoney/kmymoney/dialogs/investactivities.h:46:11: note: 
      'eMyMoney' declared here
namespace eMyMoney { namespace Split { enum class InvestmentTransactionType; } }
          ^

I am happy to help trying to get this done. It looks very promising.

This revision now requires changes to proceed.Nov 11 2017, 11:55 AM

Please see if you'll have luck with this.

I still try to avoid rename to StockSplit. Please try this time and make sure you're applying the latest diff.

tbaumgart accepted this revision as: tbaumgart.Nov 11 2017, 1:54 PM

Works for me now. I have not run intensive testing. Just a bank download and starting a report and editing a split transaction.

wojnilowicz abandoned this revision.Nov 11 2017, 2:39 PM