aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt16
-rw-r--r--src/core/function/GlobalSettingStation.cpp2
-rw-r--r--src/core/module/ModuleInit.cpp35
3 files changed, 27 insertions, 26 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5eb01927..2953e02f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -488,7 +488,7 @@ if(BUILD_APP_FOR_PACKAGE)
set(CPACK_PACKAGE_HOMEPAGE_URL "https://gpgfrontend.bktus.com")
set(CPACK_PACKAGE_FILE_NAME "${APP_NAME_LOWER}-v${PROJECT_VERSION}")
- set(CPACK_GENERATOR "RPM;DEB;Bundle")
+ set(CPACK_GENERATOR "RPM;DEB")
#
# RPM Settings
@@ -523,20 +523,6 @@ if(BUILD_APP_FOR_PACKAGE)
set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3")
#
- # macOS Bundle Settings
- #
- set(CPACK_BUNDLE_NAME "${APP_NAME}")
- set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/resource/plist/MacOSXBundleInfo.plist.in")
- set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/resource/lfs/icns/GpgFrontend.icns")
-
- if(GPGFRONTEND_XCODE_ENABLE_SANDBOX)
- message(STATUS "Build Application With App Sandbox")
- set(CPACK_BUNDLE_APPLE_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/resource/entitlements/GpgFrontend.entitlements")
- endif()
-
- set(CPACK_BUNDLE_APPLE_CERT_APP "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
-
- #
# Install scripts
#
configure_file("${CMAKE_SOURCE_DIR}/cmake/rpm/post-install.sh"
diff --git a/src/core/function/GlobalSettingStation.cpp b/src/core/function/GlobalSettingStation.cpp
index 7632f7dc..21f1c743 100644
--- a/src/core/function/GlobalSettingStation.cpp
+++ b/src/core/function/GlobalSettingStation.cpp
@@ -182,7 +182,7 @@ class GlobalSettingStation::Impl {
#if defined(__APPLE__) && defined(__MACH__)
#ifdef NDEBUG
- return exec_binary_path + "/../Modules";
+ return exec_binary_path + "/../PlugIns";
#endif
#endif
diff --git a/src/core/module/ModuleInit.cpp b/src/core/module/ModuleInit.cpp
index ed9068c7..11a57d4c 100644
--- a/src/core/module/ModuleInit.cpp
+++ b/src/core/module/ModuleInit.cpp
@@ -36,21 +36,32 @@
#include "core/thread/Task.h"
#include "core/thread/TaskRunnerGetter.h"
-namespace GpgFrontend::Module {
+namespace {
+
+auto SearchModuleFromPath(const QString& mods_path, bool integrated)
+ -> QMap<QString, bool> {
+ QMap<QString, bool> modules;
+
+ QDir dir(mods_path);
+ if (!dir.exists()) return modules;
+
+ const auto entries = dir.entryInfoList(
+ QStringList() << "*.so" << "*.dll" << "*.dylib", QDir::Files);
+
+ const QRegularExpression rx(QStringLiteral("^libgf_mod_.+$"));
-auto SearchModuleFromPath(const QString& mods_path,
- bool integrated) -> QMap<QString, bool> {
- QMap<QString, bool> m;
- for (const auto& module_library_name : QDir(mods_path).entryList(
- QStringList() << "*.so" << "*.dll" << "*.dylib", QDir::Files)) {
- m[mods_path + "/" + module_library_name] = integrated;
+ for (const auto& info : entries) {
+ if (rx.match(info.fileName()).hasMatch()) {
+ modules.insert(info.absoluteFilePath(), integrated);
+ }
}
- return m;
+
+ return modules;
}
auto LoadIntegratedMods() -> QMap<QString, bool> {
- const auto module_path =
- GlobalSettingStation::GetInstance().GetIntegratedModulePath();
+ const auto module_path = GpgFrontend::GlobalSettingStation::GetInstance()
+ .GetIntegratedModulePath();
LOG_I() << "loading integrated modules from path:" << module_path;
if (!QDir(module_path).exists()) {
@@ -75,6 +86,10 @@ auto LoadExternalMods() -> QMap<QString, bool> {
return SearchModuleFromPath(mods_path, false);
}
+} // namespace
+
+namespace GpgFrontend::Module {
+
void LoadGpgFrontendModules(ModuleInitArgs) {
// give user ability to give up all modules
auto disable_loading_all_modules =