diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-10-29 21:47:08 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-30 10:36:52 -0700 |
commit | 8dad3457ef1f412517c4d81f08ebd14680788ec3 (patch) | |
tree | fd98ffd89584e4fa7a295b0116e8594a94c92e07 /subsurface-core/pluginmanager.cpp | |
parent | 391172240ae00e9729ddb9db1b2cd50be3feb51b (diff) | |
download | subsurface-8dad3457ef1f412517c4d81f08ebd14680788ec3.tar.gz |
Make the skeleton Facebook plugin and make sure it is loaded
Currently we need to copy manually the plugin dynamic library
to the /plugins folder.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/pluginmanager.cpp')
-rw-r--r-- | subsurface-core/pluginmanager.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
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 +} |