summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2020-12-02 16:26:59 +0100
committerGitHub <noreply@github.com>2020-12-02 16:26:59 +0100
commitc3a957169612e6563b17c2e740006f1abd29f6ff (patch)
tree9af58874a46b0a8317663c958058878bc7b3df5b /src
parentb8bc0f7ab328d839a371fa0f3c11edf035407847 (diff)
parent4818eb6cfeef84a5868ae8cf2f2356845da6d485 (diff)
Merge pull request #1311 from Holt59/ipluginproxy-unload
Add IPluginProxy::unload() and rename instantiate() to load().
Diffstat (limited to 'src')
-rw-r--r--src/plugincontainer.cpp7
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(", "));