diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2020-12-02 16:26:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-02 16:26:59 +0100 |
| commit | c3a957169612e6563b17c2e740006f1abd29f6ff (patch) | |
| tree | 9af58874a46b0a8317663c958058878bc7b3df5b /src/plugincontainer.cpp | |
| parent | b8bc0f7ab328d839a371fa0f3c11edf035407847 (diff) | |
| parent | 4818eb6cfeef84a5868ae8cf2f2356845da6d485 (diff) | |
Merge pull request #1311 from Holt59/ipluginproxy-unload
Add IPluginProxy::unload() and rename instantiate() to load().
Diffstat (limited to 'src/plugincontainer.cpp')
| -rw-r--r-- | src/plugincontainer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index 44c9a651..5a485dfe 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -459,7 +459,7 @@ IPlugin* PluginContainer::registerPlugin(QObject *plugin, const QString &fileNam // If both plugins are from the same proxy and the same file, this is usually
// ok (in theory some one could write two different classes from the same Python file/module):
if (pluginProxy && m_Requirements.at(other).proxy() == pluginProxy
- && as_qobject(other)->property("filename") == fileName) {
+ && as_qobject(other)->property("filepath") == fileName) {
// Plugin has already been initialized:
skipInit = true;
@@ -484,7 +484,7 @@ IPlugin* PluginContainer::registerPlugin(QObject *plugin, const QString &fileNam // way to cast directly between IPlugin* and IPluginDiagnose*
bf::at_key<QObject>(m_Plugins).push_back(plugin);
- plugin->setProperty("filename", fileName);
+ plugin->setProperty("filepath", fileName);
if (m_Organizer) {
m_Organizer->settings().plugins().registerPlugin(pluginObj);
@@ -560,13 +560,14 @@ IPlugin* PluginContainer::registerPlugin(QObject *plugin, const QString &fileNam try {
// We get a list of matching plugins as proxies can return multiple plugins
// per file and do not have a good way of supporting multiple inheritance.
- QList<QObject*> matchingPlugins = proxy->instantiate(pluginName);
+ QList<QObject*> matchingPlugins = proxy->load(pluginName);
// We are going to group plugin by names and "fix" them later:
std::map<QString, std::vector<IPlugin*>> proxiedByNames;
for (QObject *proxiedPlugin : matchingPlugins) {
if (proxiedPlugin != nullptr) {
+
if (IPlugin* proxied = registerPlugin(proxiedPlugin, pluginName, proxy); proxied) {
log::debug("loaded plugin '{}' from '{}' - [{}]",
proxied->name(), QFileInfo(pluginName).fileName(), implementedInterfaces(proxied).join(", "));
|
