diff options
Diffstat (limited to 'subsurface-core')
-rw-r--r-- | subsurface-core/isocialnetworkintegration.h | 2 | ||||
-rw-r--r-- | subsurface-core/pluginmanager.cpp | 24 |
2 files changed, 15 insertions, 11 deletions
diff --git a/subsurface-core/isocialnetworkintegration.h b/subsurface-core/isocialnetworkintegration.h index 97ff91dc2..778a171b3 100644 --- a/subsurface-core/isocialnetworkintegration.h +++ b/subsurface-core/isocialnetworkintegration.h @@ -68,5 +68,5 @@ public: }; Q_DECLARE_INTERFACE(ISocialNetworkIntegration, "org.subsurface.ISocialNetworkIntegration.v1") - +Q_DECLARE_METATYPE(ISocialNetworkIntegration*); #endif
\ No newline at end of file diff --git a/subsurface-core/pluginmanager.cpp b/subsurface-core/pluginmanager.cpp index 290f43df0..5c0f22525 100644 --- a/subsurface-core/pluginmanager.cpp +++ b/subsurface-core/pluginmanager.cpp @@ -3,18 +3,22 @@ #include <QApplication> #include <QDir> #include <QPluginLoader> +#include <QDebug> static QList<ISocialNetworkIntegration*> _socialNetworks; -PluginManager& PluginManager::instance() { +PluginManager& PluginManager::instance() +{ static PluginManager self; return self; } -PluginManager::PluginManager() { +PluginManager::PluginManager() +{ } -void PluginManager::loadPlugins() { +void PluginManager::loadPlugins() +{ QDir pluginsDir(qApp->applicationDirPath()); #if defined(Q_OS_WIN) @@ -29,19 +33,19 @@ void PluginManager::loadPlugins() { #endif pluginsDir.cd("plugins"); + qDebug() << "Plugins Directory: " << pluginsDir; foreach (const QString& fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); - if(!plugin) { + if(!plugin) continue; - } - if (ISocialNetworkIntegration *social = qobject_cast<ISocialNetworkIntegration*>(plugin)){ + if (ISocialNetworkIntegration *social = qobject_cast<ISocialNetworkIntegration*>(plugin)) _socialNetworks.push_back(social); - } - } + } } -QList<ISocialNetworkIntegration*> PluginManager::socialNetworkIntegrationPlugins() const { +QList<ISocialNetworkIntegration*> PluginManager::socialNetworkIntegrationPlugins() const +{ return _socialNetworks; -}
\ No newline at end of file +} |