Relevant code is at https://invent.kde.org/network/kio-extras/-/blob/master/thumbnail/thumbnail.cpp#L658
Currently when loading a thumbnail plugin we:
- Take the name and pass that to KPluginLoader::findPlugin (which is deprecated) to get the full path
- Load that path via QLibrary
- Resolve the new_creator symbol
- Call new_creator to instantiate a creator
- if the plugin name starts with kf5/thumbcreator/ we create a KPluginMetaData for it
- if not we look up the metadata using KServiceTypeTrader
- profit
This is different to how we do plugins anywhere else for no apparent reason. The first half is basically reinventing KPluginFactory.
There is a 20 year old comment about this
// Don't use KPluginFactory here, this is not a QObject and // neither is ThumbCreator
If we made ThumbCreator a QObject that would allow to simplify/align that code at cost of changing all the plugins, but we need to do that anyway to get rid of KServiceTypeTrader