Commit 8d672bbd authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix instanciate plugins

parent a7d25ad2
Pipeline #75625 passed with stage
in 7 minutes and 41 seconds
......@@ -57,6 +57,7 @@ bool ImportMailPluginManager::initializePluginList()
// 2) look at if plugin is activated
info.metaDataFileNameBaseName = QFileInfo(data.fileName()).baseName();
info.metaDataFileName = data.fileName();
info.data = data;
if (pluginVersion() == data.version()) {
info.plugin = nullptr;
mPluginList.push_back(info);
......@@ -74,8 +75,8 @@ bool ImportMailPluginManager::initializePluginList()
void ImportMailPluginManager::loadPlugin(ImportMailPluginManagerInfo *item)
{
#if KCOREADDONS_VERSION > QT_VERSION_CHECK(5, 85, 0)
const auto loadResult = KPluginFactory::instantiatePlugin<LibImportWizard::AbstractImporter>(KPluginMetaData(item->metaDataFileName), this);
if (loadResult) {
if (auto plugin = KPluginFactory::instantiatePlugin<LibImportWizard::AbstractImporter>(item->data, this, QVariantList() << item->metaDataFileName).plugin) {
item->plugin = plugin;
mPluginDataList.append(item->pluginData);
}
#else
......
......@@ -36,6 +36,7 @@ public:
QString metaDataFileNameBaseName;
QString metaDataFileName;
PluginUtilData pluginData;
KPluginMetaData data;
LibImportWizard::AbstractImporter *plugin = nullptr;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment