New plugins loading system

Authored by wojnilowicz on Dec 28 2017, 4:46 AM.


New plugins loading system

Current plugins loading system crashes KMyMoney very often after quit
and doesn't allow unpluging plugins. This patch aims to improve on those
two deficiencies.


  1. use of KPluginLoader instead of QPluginLoader

KCM modules of plugins cannot use QPluginLoader, so load all plugins
with single type of plugin loader.
Loading with QPluginLoader directly causes some strange valgrind
errors(invalid read size), which are untrackable. However, it doesn't
occur with KPluginLoader.

  1. create new KSettingsPlugins page

The page has changing Apply button depending on selection. The page
allows unloading/loading plugins. The page causes plugin system to
update after changes.

  1. no method for plugins handling in KMyMoneyApp, because all is

encapsulated in pluginloader.h

  1. don't store KPluginSelector because it's needed only during


  1. use plugin diagnostics in console that looks like "Plugins: xxxplugin

(un)loaded" which allows debugging,

  1. use kcmshell5 instead of kcmshell4,
  2. use of qobject_cast instead of dynamic_cast to test plugin's

interfaces, which is faster,

  1. remove "kmm_" prefix from KMM plugins as they're private and not

public, so no name clash shouldn't occur,

  1. rename classes from something like KMMXXXImporterPlugin to something

like XXXImporter, which is shorter,

  1. allow enabling Weboob and using printcheck plugins,
  2. new m_plugins member to store all plugin interfaces.

Differential Revision:


wojnilowiczDec 30 2017, 6:13 PM
Differential Revision
D9566: New plugins loading system
R261:3d93a5524a95: Don't import duplicate transactions
christiand added inline comments.

This is potentially dangerous because weboob (the original, not our plugin) may use this folder.

wojnilowicz marked an inline comment as done.Jan 5 2018, 7:43 PM
wojnilowicz added inline comments.

I know that and I will change that.
Plugin doesn't work fully nonetheless and I'm working on it to make it usable.
The problem is deprecated Kross, that doesn't want to run python scripts anymore and no real Qt replacement on horizon. I think I'll try with embeeding Python.