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(); }