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 | |
| parent | 7a4cdc8f810dc1ae49e9b53e4641f1419f5d66c5 (diff) | |
Ties plugin to the PluginContainer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/organizer_en.ts | 22 | ||||
| -rw-r--r-- | src/plugincontainer.cpp | 7 |
2 files changed, 16 insertions, 13 deletions
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?</source> <context> <name>PluginContainer</name> <message> - <location filename="plugincontainer.cpp" line="1010"/> + <location filename="plugincontainer.cpp" line="1013"/> <source>Plugin error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1011"/> + <location filename="plugincontainer.cpp" line="1014"/> <source>Mod Organizer failed to load the plugin '%1' last time it was started.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1014"/> + <location filename="plugincontainer.cpp" line="1017"/> <source>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.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1019"/> + <location filename="plugincontainer.cpp" line="1022"/> <source>Skip this plugin</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1020"/> + <location filename="plugincontainer.cpp" line="1023"/> <source>Blacklist this plugin</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1021"/> + <location filename="plugincontainer.cpp" line="1024"/> <source>Load this plugin</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1118"/> + <location filename="plugincontainer.cpp" line="1121"/> <source>Some plugins could not be loaded</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1121"/> - <location filename="plugincontainer.cpp" line="1139"/> + <location filename="plugincontainer.cpp" line="1124"/> + <location filename="plugincontainer.cpp" line="1142"/> <source>Description missing</source> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="1130"/> + <location filename="plugincontainer.cpp" line="1133"/> <source>The following plugins could not be loaded. The reason may be missing dependencies (i.e. python) or an outdated version:</source> <translation type="unfinished"></translation> </message> @@ -7413,7 +7413,7 @@ Destination:<byte value="xd"/> <translation type="unfinished"></translation> </message> <message> - <location filename="plugincontainer.cpp" line="796"/> + <location filename="plugincontainer.cpp" line="797"/> <source>failed to initialize plugin %1: %2</source> <translation type="unfinished"></translation> </message> 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);
}
|
