From 14c6ee4d27b443d271b59d894ac6c06028aa45ff Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 28 Apr 2022 13:24:27 +0200 Subject: Ties plugin to the PluginContainer. --- src/organizer_en.ts | 22 +++++++++++----------- src/plugincontainer.cpp | 7 +++++-- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 25f7e86c..d5b32741 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -5909,48 +5909,48 @@ Continue? PluginContainer - + Plugin error - + Mod Organizer failed to load the plugin '%1' last time it was started. - + The plugin can be skipped for this session, blacklisted, or loaded normally, in which case it might fail again. Blacklisted plugins can be re-enabled later in the settings. - + Skip this plugin - + Blacklist this plugin - + Load this plugin - + Some plugins could not be loaded - - + + Description missing - + The following plugins could not be loaded. The reason may be missing dependencies (i.e. python) or an outdated version: @@ -7413,7 +7413,7 @@ Destination: - + failed to initialize plugin %1: %2 diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index c4640cc3..61169196 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -467,8 +467,8 @@ IPlugin* PluginContainer::registerPlugin(QObject *plugin, const QString& filepat } } else { - log::warn("Trying to register two plugins with the name '{}', the second one will not be registered.", - pluginObj->name()); + log::warn("Trying to register two plugins with the name '{}' (from {} and {}), the second one will not be registered.", + pluginObj->name(), this->filepath(other), QDir::cleanPath(filepath)); return nullptr; } } @@ -481,6 +481,7 @@ IPlugin* PluginContainer::registerPlugin(QObject *plugin, const QString& filepat bf::at_key(m_Plugins).push_back(plugin); plugin->setProperty("filepath", QDir::cleanPath(filepath)); + plugin->setParent(this); if (m_Organizer) { m_Organizer->settings().plugins().registerPlugin(pluginObj); @@ -921,6 +922,8 @@ void PluginContainer::unloadPlugin(MOBase::IPlugin* plugin, QObject* object) } + object->deleteLater(); + // Do this at the end. m_Requirements.erase(plugin); } -- cgit v1.3.1