aboutsummaryrefslogtreecommitdiffstats
path: root/src/module/GpgFrontendModuleInit.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-10-17 14:57:03 +0000
committersaturneric <[email protected]>2023-10-17 14:57:03 +0000
commite5694e9f6d2a84954eaf508557caa795f5282b07 (patch)
tree40dd946005f7d5b7cdab7db608367add5bbdb38b /src/module/GpgFrontendModuleInit.cpp
parentrefactor: flatpak yml file can not host here (diff)
downloadGpgFrontend-e5694e9f6d2a84954eaf508557caa795f5282b07.tar.gz
GpgFrontend-e5694e9f6d2a84954eaf508557caa795f5282b07.zip
refactor: change plugin system to module system
Diffstat (limited to '')
-rw-r--r--src/module/GpgFrontendModuleInit.cpp (renamed from src/plugin/GpgFrontendPluginInit.cpp)36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/plugin/GpgFrontendPluginInit.cpp b/src/module/GpgFrontendModuleInit.cpp
index a21432c7..53f71b71 100644
--- a/src/plugin/GpgFrontendPluginInit.cpp
+++ b/src/module/GpgFrontendModuleInit.cpp
@@ -26,7 +26,7 @@
*
*/
-#include "GpgFrontendPluginInit.h"
+#include "GpgFrontendModuleInit.h"
#include <spdlog/async.h>
#include <spdlog/common.h>
@@ -36,25 +36,27 @@
#include <memory>
#include "core/function/GlobalSettingStation.h"
-#include "plugin/system/PluginManager.h"
+#include "module/system/PluginManager.h"
// integrated plugins
-#include "module/version_checking_plugin/VersionCheckingPlugin.h"
+#include "integrated/version_checking_module/VersionCheckingModule.h"
-namespace GpgFrontend::Plugin {
+namespace GpgFrontend::Module {
-void LoadGpgFrontendIntegratedPlugins() {
- PluginManager::GetInstance()->RegisterPlugin(
- std::make_shared<Module::VersionCheckingPlugin::VersionCheckingPlugin>());
+void LoadGpgFrontendIntegratedModules() {
+ SPDLOG_INFO("loading integrated module...");
+ ModuleManager::GetInstance()->RegisterPlugin(
+ std::make_shared<
+ Integrated::VersionCheckingModule::VersionCheckingModule>());
}
-void InitPluginLoggingSystem() {
+void InitModuleLoggingSystem() {
using namespace boost::posix_time;
using namespace boost::gregorian;
// get the log directory
auto logfile_path =
- (GpgFrontend::GlobalSettingStation::GetInstance().GetLogDir() / "plugin");
+ (GpgFrontend::GlobalSettingStation::GetInstance().GetLogDir() / "module");
logfile_path.replace_extension(".log");
// sinks
@@ -67,26 +69,26 @@ void InitPluginLoggingSystem() {
spdlog::init_thread_pool(1024, 2);
// logger
- auto plugin_logger = std::make_shared<spdlog::async_logger>(
- "ui", begin(sinks), end(sinks), spdlog::thread_pool());
- plugin_logger->set_pattern(
+ auto module_logger = std::make_shared<spdlog::async_logger>(
+ "plugin", begin(sinks), end(sinks), spdlog::thread_pool());
+ module_logger->set_pattern(
"[%H:%M:%S.%e] [T:%t] [%=4n] %^[%=8l]%$ [%s:%#] [%!] -> %v (+%ius)");
#ifdef DEBUG
- plugin_logger->set_level(spdlog::level::trace);
+ module_logger->set_level(spdlog::level::trace);
#else
ui_logger->set_level(spdlog::level::info);
#endif
// flush policy
- plugin_logger->flush_on(spdlog::level::err);
+ module_logger->flush_on(spdlog::level::err);
spdlog::flush_every(std::chrono::seconds(5));
// register it as default logger
- spdlog::set_default_logger(plugin_logger);
+ spdlog::set_default_logger(module_logger);
}
-void ShutdownPluginLoggingSystem() {
+void ShutdownModuleLoggingSystem() {
#ifdef WINDOWS
// Under VisualStudio, this must be called before main finishes to workaround
// a known VS issue
@@ -94,4 +96,4 @@ void ShutdownPluginLoggingSystem() {
spdlog::shutdown();
#endif
}
-} // namespace GpgFrontend::Plugin \ No newline at end of file
+} // namespace GpgFrontend::Module \ No newline at end of file