##// END OF EJS Templates
Initializes plugin manager...
Alexandre Leroux -
r66:5cbeec46f38d
parent child
Show More
@@ -0,0 +1,34
1 #ifndef SCIQLOP_PLUGINMANAGER_H
2 #define SCIQLOP_PLUGINMANAGER_H
3
4 #include <Common/spimpl.h>
5
6 #include <QLoggingCategory>
7
8 class QDir;
9
10 Q_DECLARE_LOGGING_CATEGORY(LOG_PluginManager)
11
12 /**
13 * @brief The PluginManager class aims to handle the plugins loaded dynamically into SciQLop.
14 */
15 class PluginManager {
16 public:
17 explicit PluginManager();
18
19 /**
20 * Loads plugins into SciQlop. The loaded plugins are those located in the directory passed in
21 * parameter
22 * @param pluginDir the directory containing the plugins
23 */
24 void loadPlugins(const QDir &pluginDir);
25
26 /// @returns the number of plugins loaded
27 int nbPluginsLoaded() const noexcept;
28
29 private:
30 class PluginManagerPrivate;
31 spimpl::unique_impl_ptr<PluginManagerPrivate> impl;
32 };
33
34 #endif // SCIQLOP_PLUGINMANAGER_H
@@ -0,0 +1,29
1 #include <Plugin/PluginManager.h>
2
3 #include <Plugin/IPlugin.h>
4
5 #include <QDir>
6
7 Q_LOGGING_CATEGORY(LOG_PluginManager, "PluginManager")
8
9 struct PluginManager::PluginManagerPrivate {
10 };
11
12 PluginManager::PluginManager() : impl{spimpl::make_unique_impl<PluginManagerPrivate>()}
13 {
14 }
15
16 void PluginManager::loadPlugins(const QDir &pluginDir)
17 {
18 // Load plugins
19 auto pluginInfoList = pluginDir.entryInfoList(QDir::Files, QDir::Name);
20 for (auto pluginInfo : qAsConst(pluginInfoList)) {
21 /// @todo ALX
22 }
23 }
24
25 int PluginManager::nbPluginsLoaded() const noexcept
26 {
27 /// @todo ALX
28 return 0;
29 }
@@ -16,7 +16,11 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
16 "${INCLUDES_DIR}/Version.h")
16 "${INCLUDES_DIR}/Version.h")
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
18 "${SOURCES_DIR}/Version.cpp")
18 "${SOURCES_DIR}/Version.cpp")
19
19
20 # Find dependent modules
21 find_package(sciqlop-plugin)
22 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
23
20 #
24 #
21 # Find Qt modules
25 # Find Qt modules
22 #
26 #
General Comments 5
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 1 added
  * 0 removed

Changed files:
  * M core/CMakeLists.txt
Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now