[Kmymoney-devel] Debugging plugins

Chris DeveloperChris at rebel.com.au
Sat Mar 29 22:53:50 UTC 2014


Hi

Yes I worked out that kmymoney wasn't using QT's plugin mechanism but 
instead KDE's

I was just trying to workout the desktop files and where they are kept when 
I got this email. So thanks for that.

<rant>Can I say this appears crazy. KDE appears to be trying to make itself 
as complex as windows. On this front they have over achieved this. It is my 
opinion that loading application specific plugins should be handled by the 
application itself. Obfuscating the handling of plugins like this is just 
plain madness.</rant>

Moving the desktop files into the build folder didn't work! (I was hopeful)

Search paths for libs on windows are as sane as every other environment. 
FIRST you look in the application folder THEN you look into the various 
search paths. That's the correct way to do it and what one would expect for 
plugins. Unfortunately plugins are treated more like "assemblies" are 
treated in windows which is to say they need to be installed before they can 
be used. I have never debugged assemblies but I am sure there is a mechanism 
for doing so.

It would appear in KDE you need to pollute your application name space to 
debug a plugin which means you cannot simultaneously have a devel version 
and a release version running at the same time.

Ever thought of breaking KMymoney out of the dependency on KDE? It would 
have much wider appeal.

Chris


On 29/03/2014 8:41 PM, Thomas Baumgart wrote:
> 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.
>



More information about the KMyMoney-devel mailing list