[Kmymoney-devel] Debugging plugins

Thomas Baumgart thb at net-bembel.de
Sat Mar 29 10:11:25 UTC 2014


Hi Chris,

@Cristian: please read very last sentence of this mail. TIA.


On Saturday 29 March 2014 11:51:31 Chris wrote:

> Hi Guys
> 
> I am trying to debug the csv import plugin layout problem. It appears the
> default font may be a large part of the problem but not all of it.
> 
> What I can't work out is to how to actually debug the plugin inside of
> msvc2010. KMyMoney does not load the plugin at all when run from the build
> directory and when installed it loads the plugin from the libs directory but
> because there is no symbol file msvc cant step into it.
> 
> It seems mildly insane to have to install and copy the symbols into the libs
> folder everytime I make a code change!!!
> 
> I have tried telling QT to use the build folder but it seems to ignore it

I am not sure about the MS world and the KDE prerequisites in it, but on *NIX 
systems there is a KDE configuration settings that tells KDE where to search 
certain pieces of information. To see where KDE searches for libs, I run

thb at thb-nb:~$ kde4-config --path lib
/home/thb/.kde4/lib64/:/usr/lib64/

and see the directories where libraries are searched. For plugins, you need 
some more I believe and it is called servicetypes, services and modules. 
Here's the corresponding output on my system:

thb at thb-nb:~$ kde4-config --path servicetypes
/home/thb/.kde4/share/kde4/servicetypes/:/usr/share/kde4/servicetypes/
thb at thb-nb:~$ kde4-config --path services
/home/thb/.kde4/share/kde4/services/:/usr/share/kde4/services/
thb at thb-nb:~$ kde4-config --path module
/home/thb/.kde4/lib64/kde4/:/usr/lib64/kde4/

Looking into the system folders listed, I find the following files (after 
installation that is):

thb at thb-nb:~$ ls /usr/lib64/libkmm*
/usr/lib64/libkmm_kdchart.so         /usr/lib64/libkmm_plugin.so
/usr/lib64/libkmm_kdchart.so.4       /usr/lib64/libkmm_plugin.so.4
/usr/lib64/libkmm_kdchart.so.4.11.5  /usr/lib64/libkmm_plugin.so.4.11.5
/usr/lib64/libkmm_mymoney.so         /usr/lib64/libkmm_widgets.so
/usr/lib64/libkmm_mymoney.so.4       /usr/lib64/libkmm_widgets.so.4
/usr/lib64/libkmm_mymoney.so.4.11.5  /usr/lib64/libkmm_widgets.so.4.11.5

thb at thb-nb:~$ ls /usr/share/kde4/servicetypes/kmymoney*
/usr/share/kde4/servicetypes/kmymoneyimporterplugin.desktop
/usr/share/kde4/servicetypes/kmymoneyplugin.desktop


thb at thb-nb:~$ ls /usr/share/kde4/services/kmm*
/usr/share/kde4/services/kmm_csvexport.desktop
/usr/share/kde4/services/kmm_csvimport.desktop
/usr/share/kde4/services/kmm_icalendarexport.desktop
/usr/share/kde4/services/kmm_kbanking.desktop
/usr/share/kde4/services/kmm_ofximport.desktop
/usr/share/kde4/services/kmm_printcheck.desktop
/usr/share/kde4/services/kmm_reconciliationreport.desktop

and finally the plugin code contained in

thb at thb-nb:~$ ls /usr/lib64/kde4/kmm*
/usr/lib64/kde4/kmm_csvexport.so
/usr/lib64/kde4/kmm_csvimport.so
/usr/lib64/kde4/kmm_icalendarexport.so
/usr/lib64/kde4/kmm_kbanking.so
/usr/lib64/kde4/kmm_ofximport.so
/usr/lib64/kde4/kmm_printcheck.so
/usr/lib64/kde4/kmm_reconciliationreport.so

Starting KMyMoney shows the following:

thb at thb-nb:~$ kmymoney 
7:2014/03/29 10-56-17:aqbanking(2794):started
KMyMoney kbanking plugin loaded
KMyMoney reconciliation report plugin loaded
KMyMoney csvimport plugin loaded
KMyMoney printcheck plugin loaded
QFSFileEngine::open: No file name specified
KMyMoney ofximport plugin loaded
KMyMoney csvexport plugin loaded
KMyMoney iCalendar plugin loaded

Now I moved the 'installed' plugin library to the local path shown in '--path 
module' above:

thb-nb:/home/thb # mv /usr/lib64/kde4/kmm_kbanking.so 
/home/thb/.kde4/lib64/kde4/

and start KMyMoney again:

thb at thb-nb:~$ kmymoney 
7:2014/03/29 10-58-11:aqbanking(3593):started
KMyMoney kbanking plugin loaded
KMyMoney reconciliation report plugin loaded
KMyMoney csvimport plugin loaded
KMyMoney printcheck plugin loaded
QFSFileEngine::open: No file name specified
KMyMoney ofximport plugin loaded
KMyMoney csvexport plugin loaded
KMyMoney iCalendar plugin loaded


Voilà: plugin picked up and loaded from local location.

> I have added the path to the bin folder to QT_PLUGIN_PATH I have also tried
> adding the application path by calling
> QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
> inside the KApplication Constructor
> 
> Both methods succesfully prepend the build folder to the plugin path but it
> makes no difference. The plugins (none of them) are loaded.

Yes, because KDE does not take QT_PLUGIN_PATH into account.

> All the plugins are in the same folder as the application. The app runs, it
> just has no loaded plugins.
> 
> I also added the application path to the PATH env. No luck whatsoever.
> 
> Without copying the plugins to the lib folder each time how can I debug it?

I have no idea, if you can do the same thing on a Windows system, but I am 
sure, Crisitan can help you out.

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
Hexdump should be compulsory at kindergarten! -- Jos van den Oever
Found on http://www.kdedevelopers.org/node/3569
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20140329/21d7f5fe/attachment-0001.sig>


More information about the KMyMoney-devel mailing list