diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-12-01 21:21:26 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-12-01 21:21:26 +0100 |
| commit | 4818eb6cfeef84a5868ae8cf2f2356845da6d485 (patch) | |
| tree | 511a46f441cb0a70c0dcbb44930b25d4bd31e464 /src/plugincontainer.cpp | |
| parent | 1ec3ab2b8a845f75495b4cacbeb17c86ea137a01 (diff) | |
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(", "));
|
