From 34decf396cd1a953d479a3706d718fa3be738555 2017-06-07 16:06:57 From: Alexandre Leroux Date: 2017-06-07 16:06:57 Subject: [PATCH] Loads SciQlop plugins --- diff --git a/app/src/Main.cpp b/app/src/Main.cpp index cb3a380..1533e01 100644 --- a/app/src/Main.cpp +++ b/app/src/Main.cpp @@ -25,6 +25,16 @@ #include #include +#include +#include + +namespace { + +/// Name of the directory containing the plugins +const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins"); + +} // namespace + int main(int argc, char *argv[]) { SqpApplication a{argc, argv}; @@ -34,5 +44,16 @@ int main(int argc, char *argv[]) MainWindow w; w.show(); + // Loads plugins + auto pluginDir = QDir{sqpApp->applicationDirPath()}; + pluginDir.mkdir(PLUGIN_DIRECTORY_NAME); + pluginDir.cd(PLUGIN_DIRECTORY_NAME); + + qCDebug(LOG_PluginManager()) + << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath()); + + PluginManager pluginManager{}; + pluginManager.loadPlugins(pluginDir); + return a.exec(); }