Consider changing the way the factory name in K_PLUGIN_CLASS_WITH_JSON is generated
Open, Needs TriagePublic

Description

Currently the word "Factory" is just appended to the classname::

#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile) K_PLUGIN_FACTORY_WITH_JSON(classname##Factory, jsonFile, registerPlugin<classname>();)

This means the macro is not working for any classes that are within namespace and where no using namespace statement is used. That kinda defeats the point of it being an utility macro.

My suggestion would be to set a target property in the kcoreaddon_add_plugin macro and use that if it is set. The value could be the target name. Most of the time the factory name does not matter anyways. But in case we want to generate Q_IMPORT_PLUGIN statements like in T14727 it could be really useful to know this at configure time.

This would also allow one to get rid of the namespace problem described above.