Fix OFX statement importing
ClosedPublic

Authored by wojnilowicz on May 11 2018, 3:28 PM.

Details

Summary

This patch intends to fix a regression, which has been described in the
following post
https://mail.kde.org/pipermail/kmymoney-devel/2018-March/020669.html

Test Plan

Untested

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.May 11 2018, 3:28 PM
wojnilowicz created this revision.

What is the pre-requisite for this patch? I can't apply it to current master.

thb@thb-nb:~/devel/kmymoney (master)$ arc patch D12829
 INFO  Base commit is not in local repository; trying to fetch.
Created and checked out branch arcpatch-D12829.
Checking patch kmymoney/plugins/statementinterface.h...
Checking patch kmymoney/plugins/ofx/import/ofximporter.h...
Checking patch kmymoney/plugins/ofx/import/ofximporter.cpp...
Checking patch kmymoney/plugins/kbanking/kbanking.cpp...
Checking patch kmymoney/plugins/interfaces/kmmstatementinterface.h...
error: while searching for:
  /**
    * This method imports a MyMoneyStatement into the engine
    */
  bool import(const MyMoneyStatement& s, bool silent = false) final override;

  /**
   * This method returns the account for a given @a key - @a value pair.

error: patch failed: kmymoney/plugins/interfaces/kmmstatementinterface.h:51
Checking patch kmymoney/plugins/interfaces/kmmstatementinterface.cpp...
Applied patch kmymoney/plugins/statementinterface.h cleanly.
Applied patch kmymoney/plugins/ofx/import/ofximporter.h cleanly.
Applied patch kmymoney/plugins/ofx/import/ofximporter.cpp cleanly.
Applied patch kmymoney/plugins/kbanking/kbanking.cpp cleanly.
Applying patch kmymoney/plugins/interfaces/kmmstatementinterface.h with 1 reject...
Rejected hunk #1.
Applied patch kmymoney/plugins/interfaces/kmmstatementinterface.cpp cleanly.

 Patch Failed! 
Usage Exception: Unable to apply patch!

What is the pre-requisite for this patch? I can't apply it to current master.

thb@thb-nb:~/devel/kmymoney (master)$ arc patch D12829
 INFO  Base commit is not in local repository; trying to fetch.
Created and checked out branch arcpatch-D12829.
Checking patch kmymoney/plugins/statementinterface.h...
Checking patch kmymoney/plugins/ofx/import/ofximporter.h...
Checking patch kmymoney/plugins/ofx/import/ofximporter.cpp...
Checking patch kmymoney/plugins/kbanking/kbanking.cpp...
Checking patch kmymoney/plugins/interfaces/kmmstatementinterface.h...
error: while searching for:
  /**
    * This method imports a MyMoneyStatement into the engine
    */
  bool import(const MyMoneyStatement& s, bool silent = false) final override;

  /**
   * This method returns the account for a given @a key - @a value pair.

error: patch failed: kmymoney/plugins/interfaces/kmmstatementinterface.h:51
Checking patch kmymoney/plugins/interfaces/kmmstatementinterface.cpp...
Applied patch kmymoney/plugins/statementinterface.h cleanly.
Applied patch kmymoney/plugins/ofx/import/ofximporter.h cleanly.
Applied patch kmymoney/plugins/ofx/import/ofximporter.cpp cleanly.
Applied patch kmymoney/plugins/kbanking/kbanking.cpp cleanly.
Applying patch kmymoney/plugins/interfaces/kmmstatementinterface.h with 1 reject...
Rejected hunk #1.
Applied patch kmymoney/plugins/interfaces/kmmstatementinterface.cpp cleanly.

 Patch Failed! 
Usage Exception: Unable to apply patch!

I believe it's D12782. Why don't you try it from the first to the last patch?

tbaumgart requested changes to this revision.May 11 2018, 8:06 PM

Yes, that looks better, but

[ 68%] Building CXX object kmymoney/plugins/csv/import/CMakeFiles/csvimporter.dir/csvimporter.cpp.o
/home/thb/devel/kmymoney/kmymoney/plugins/csv/import/csvimporter.cpp: In member function ‘bool CSVImporter::slotGetStatement(MyMoneyStatement&)’:
/home/thb/devel/kmymoney/kmymoney/plugins/csv/import/csvimporter.cpp:76:54: error: cannot convert ‘QStringList’ to ‘bool’ in initialization
   bool ret = statementInterface()->import(s, m_silent);
                                                      ^
kmymoney/plugins/csv/import/CMakeFiles/csvimporter.dir/build.make:119: recipe for target 'kmymoney/plugins/csv/import/CMakeFiles/csvimporter.dir/csvimporter.cpp.o' failed
make[2]: *** [kmymoney/plugins/csv/import/CMakeFiles/csvimporter.dir/csvimporter.cpp.o] Error 1
CMakeFiles/Makefile2:4004: recipe for target 'kmymoney/plugins/csv/import/CMakeFiles/csvimporter.dir/all' failed
make[1]: *** [kmymoney/plugins/csv/import/CMakeFiles/csvimporter.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Please make sure that all plugins compile if you change an interface. I expect other importer plugins to fail compilation as well.

This revision now requires changes to proceed.May 11 2018, 8:06 PM
tbaumgart accepted this revision.May 12 2018, 6:35 AM

Looks OK to me now. I have only tested KBanking imports which were good.

This revision is now accepted and ready to land.May 12 2018, 6:35 AM
This revision was automatically updated to reflect the committed changes.