[Kmymoney-devel] Some experimentd trying to move loading methods out of the GUI
Michaël Lhomme
papylhomme at gmail.com
Mon Oct 19 19:38:16 CEST 2009
Hello,
as I already discussed a bit with Thomas and Alvaro, I'm working on an
Akonadi resource to display schedules as todos. The most difficult part was
to use existing loading methods (in kmymoneyview) without loading the KMM
GUI.
The solution I chose is to create a small class dedicated on data loading. I
extracted the main method KMyMoneyView::readFile and related methods
(checkAccountName, loadDefaultCurrency, loadDefaultCurrencies,
loadAncientCurrency, loadAncientCurrencies and ungetString). Then I replaced
every "messagebox" and "return false" statements by exceptions. This made
the trick for the compilation.
The next problem was linkage : KGncReader depends on various dialogs,
depending themselves on other part of the application, and so on. Finally I
ended up including every KMM libs, and declaring a main pointer to the
application in my resource (KMyMoney2App* kmymoney2). It's working but it's
really ugly ;)
And voila, I hope my experience could help.
Regards,
Michaël Lhomme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kmymoney-devel/attachments/20091019/f3548370/attachment.htm
More information about the KMyMoney-devel
mailing list