diff options
| author | Silarn <jrim@rimpo.org> | 2018-05-02 17:04:50 -0500 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2018-05-02 17:04:50 -0500 |
| commit | e3989fe8f93a37d18f7c92785469a9ab87949041 (patch) | |
| tree | 9377e288622af09a475f23bbd1cfccb1514d2a0f /src/plugincontainer.cpp | |
| parent | f7c9b8c3336da02d3360b810247c00494df114fd (diff) | |
| parent | 5555a58f8454063e66dd9a29449fcb19f73a0687 (diff) | |
Merge branch 'Develop' of https://github.com/Modorganizer2/modorganizer into Develop
Diffstat (limited to 'src/plugincontainer.cpp')
| -rw-r--r-- | src/plugincontainer.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index f6376496..8935c472 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -155,14 +155,18 @@ bool PluginContainer::registerPlugin(QObject *plugin, const QString &fileName) QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::pluginPath()));
for (const QString &pluginName : pluginNames) {
try {
- QObject *proxiedPlugin = proxy->instantiate(pluginName);
- if (proxiedPlugin != nullptr) {
- if (registerPlugin(proxiedPlugin, pluginName)) {
- qDebug("loaded plugin \"%s\"", qPrintable(QFileInfo(pluginName).fileName()));
- } else {
- qWarning("plugin \"%s\" failed to load. If this plugin is for an older version of MO "
- "you have to update it or delete it if no update exists.",
- qPrintable(pluginName));
+ // we get a list of matching plugins as proxies don't necessarily have a good way of supporting multiple inheritance
+ QList<QObject*> matchingPlugins = proxy->instantiate(pluginName);
+ for (QObject *proxiedPlugin : matchingPlugins) {
+ if (proxiedPlugin != nullptr) {
+ if (registerPlugin(proxiedPlugin, pluginName)) {
+ qDebug("loaded plugin \"%s\"", qPrintable(QFileInfo(pluginName).fileName()));
+ }
+ else {
+ qWarning("plugin \"%s\" failed to load. If this plugin is for an older version of MO "
+ "you have to update it or delete it if no update exists.",
+ qPrintable(pluginName));
+ }
}
}
} catch (const std::exception &e) {
|
