diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2022-04-28 13:24:27 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2022-05-02 17:04:04 +0200 |
| commit | 14c6ee4d27b443d271b59d894ac6c06028aa45ff (patch) | |
| tree | 871f82d476860063c5402594c10e557de5b7d2d8 /src/plugincontainer.cpp | |
| parent | 7a4cdc8f810dc1ae49e9b53e4641f1419f5d66c5 (diff) | |
Ties plugin to the PluginContainer.
Diffstat (limited to 'src/plugincontainer.cpp')
| -rw-r--r-- | src/plugincontainer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<QObject>(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);
}
|
