I am debugging a plugin that is loaded by the ( IIRC) KDEPluginLoader class.
The problem is that whenever I have made modifications to the plugin, they are not seen.
This is because the application is loading the plugin from the "system plugin area". I do not want to put this plugin in that area. ( and really I shouldn't have to.) But lsof points to the plugin in the system area.
How do I get the application to load plugins from the compile directory first?
Default Plugin Folders
Next to the global paths, e.g.
the local paths are also scanned, i.e.
The first time you copy a library into one of these paths, you have to launch
kbuildsycoca4
(which stands for: K Build SYstem COnfiguration CAche). This cache is used by KDE's plugin system to quickly search for services (plugins).Note, that the information in the .desktop file must point to the correct library filename. For instance,
/usr/share/kde4/services/ktexteditor_hlselection.desktop
says:So KDE's plugin architecture will look for:
The one in the home folder has higher priority.
Custom Plugin Folders
You can tell KDE to look into more folders for the services (.desktop files) and libraries (*.so files). This requires you to set several environment folders, e.g.:
The latter will then search in: /path/to/share/kde4/services/ for *.desktop files.
Make sure you run kbuildsycoca4 with the environment variables set. Then start your application from a shell where your environment variables are set.
I have not tested this, so these instructions especially with respect to XDG_DATA_DIRS may not work out of the box. But it should bring you a lot closer to your goal.
Update: You don't need a desktop file and XDG_DATA_DIRS if you already have a respective .desktop file in one of the services folders. So setting LD_LIBRARY_PATH in this case should do the trick.