aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/module/ModuleInit.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-07-30 17:33:21 +0000
committersaturneric <[email protected]>2024-07-30 17:33:21 +0000
commit02edad4c989f60e248657bb7854253f8297db583 (patch)
tree0fa307c34d270f42ba1ad90da819c259d744f283 /src/core/module/ModuleInit.cpp
parentfeat: should check build capability at dev branch (diff)
downloadGpgFrontend-02edad4c989f60e248657bb7854253f8297db583.tar.gz
GpgFrontend-02edad4c989f60e248657bb7854253f8297db583.zip
fix: use standard os detection macro
Diffstat (limited to 'src/core/module/ModuleInit.cpp')
-rw-r--r--src/core/module/ModuleInit.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/module/ModuleInit.cpp b/src/core/module/ModuleInit.cpp
index ae784279..4fedc6c7 100644
--- a/src/core/module/ModuleInit.cpp
+++ b/src/core/module/ModuleInit.cpp
@@ -47,25 +47,26 @@ void LoadModuleFromPath(const QString& mods_path, bool integrated) {
}
auto LoadIntegratedMods() -> bool {
- auto exec_binary_path = QCoreApplication::applicationDirPath();
+ const auto exec_binary_path = QCoreApplication::applicationDirPath();
+ QString mods_path = exec_binary_path + "/modules";
-#if defined(MACOS) && defined(RELEASE)
- // App Bundle
- auto mods_path = exec_binary_path + "/../Modules";
-#else
- // Debug Or Windows Platform
- auto mods_path = exec_binary_path + "/modules";
-#endif
+#ifdef NDEBUG
+#if defined(__APPLE__) && defined(__MACH__)
+ // App Bundle
+ mods_path = exec_binary_path + "/../Modules";
+#elif defined(__linux__)
// AppImage
if (!qEnvironmentVariable("APPIMAGE").isEmpty()) {
mods_path = qEnvironmentVariable("APPDIR") + "/usr/modules";
}
-
// Flatpak
if (!qEnvironmentVariable("container").isEmpty()) {
mods_path = "/app/modules";
}
+#endif
+
+#endif
if (!QDir(mods_path).exists()) {
qCWarning(core) << "integrated module directory at path: " << mods_path