aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2024-02-01 12:21:31 +0000
committerGitHub <[email protected]>2024-02-01 12:21:31 +0000
commitd5e6fdb044d42020c892e6a8cd6364567cb5451e (patch)
tree4384fe2f5357d44e65319b294180c87e0769cfb5 /src
parentMerge pull request #128 from saturneric/dev/2.1.1/main (diff)
parentfix: slove ci issues (diff)
downloadGpgFrontend-d5e6fdb044d42020c892e6a8cd6364567cb5451e.tar.gz
GpgFrontend-d5e6fdb044d42020c892e6a8cd6364567cb5451e.zip
Merge pull request #129 from saturneric/dev/2.1.1/main
Develop 2.1.2.4
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt19
-rw-r--r--src/core/CMakeLists.txt8
-rw-r--r--src/core/function/GlobalSettingStation.cpp22
-rw-r--r--src/ui/dialog/WaitingDialog.cpp1
4 files changed, 44 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e47e2bae..8fa51056 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -179,7 +179,7 @@ if (BUILD_APPLICATION)
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
unset(_libDllPath)
- file(GLOB _libDllPath "${_libDllBinPath}/libassuan-*.dll")
+ file(GLOB _libDllPath "${_libDllBinPath}/libassuan*.dll")
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
unset(_libDllPath)
@@ -207,11 +207,11 @@ if (BUILD_APPLICATION)
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
unset(_libDllPath)
- file(GLOB _libDllPath "${_libDllBinPath}/libgpg-error-*.dll")
+ file(GLOB _libDllPath "${_libDllBinPath}/libgpg-error*.dll")
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
unset(_libDllPath)
- file(GLOB _libDllPath "${_libDllBinPath}/libgpgme-*.dll")
+ file(GLOB _libDllPath "${_libDllBinPath}/libgpgme*.dll")
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
unset(_libDllPath)
@@ -279,9 +279,20 @@ if (BUILD_APPLICATION)
file(GLOB _libDllPath "${_libDllBinPath}/libxml2-*.dll")
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
+ # /mingw64/libexec
+ execute_process(
+ COMMAND cygpath -m /mingw64/libexec
+ OUTPUT_VARIABLE MSYS64_LIBEXEC_PATH
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
# gpgme-w32spawn.exe
unset(_libExEPath)
- file(GLOB _libExEPath "${_libDllBinPath}/gpgme-w32spawn.exe")
+ file(GLOB _libExEPath "${MSYS64_LIBEXEC_PATH}/gpgme-*.exe")
+ list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libExEPath})
+
+ unset(_libExEPath)
+ file(GLOB _libExEPath "${_libDllBinPath}/gpgme-*.exe")
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libExEPath})
set(ALL_RUNTIME_DLL_FILES "")
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index b5dd3571..cc1f6742 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -74,7 +74,13 @@ endif ()
# spdlog
target_link_libraries(gpgfrontend_core PRIVATE spdlog)
-
+if(MINGW)
+ set_target_properties(spdlog
+ PROPERTIES
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+ )
+endif()
# configure libarchive
if(NOT MINGW)
diff --git a/src/core/function/GlobalSettingStation.cpp b/src/core/function/GlobalSettingStation.cpp
index 594b6661..7b21ebca 100644
--- a/src/core/function/GlobalSettingStation.cpp
+++ b/src/core/function/GlobalSettingStation.cpp
@@ -59,12 +59,26 @@ class GlobalSettingStation::Impl {
GF_CORE_LOG_INFO("app data path: {}", app_data_path_);
GF_CORE_LOG_INFO("app log path: {}", app_log_path_);
+#ifdef WINDOWS
+ GF_CORE_LOG_INFO("app config path: {}", app_config_path_);
+#endif
+
+#ifdef WINDOWS
+ if (!QDir(app_config_path_).exists()) QDir(app_config_path_).mkpath(".");
+#endif
+
if (!QDir(app_data_path_).exists()) QDir(app_data_path_).mkpath(".");
if (!QDir(app_log_path_).exists()) QDir(app_log_path_).mkpath(".");
}
[[nodiscard]] auto GetSettings() -> QSettings {
- if (!portable_mode_) return QSettings();
+ if (!portable_mode_) {
+#ifdef WINDOWS
+ return QSettings(app_config_target_path_, QSettings::IniFormat);
+#else
+ return QSettings();
+#endif
+ }
return {app_portable_config_path_, QSettings::IniFormat};
}
@@ -116,11 +130,17 @@ class GlobalSettingStation::Impl {
QString app_data_path_ = QString{QStandardPaths::writableLocation(
QStandardPaths::AppLocalDataLocation)}; ///< Program Data Location
+ QString app_config_path_ = QString{
+ QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)};
+
QString app_log_path_ = app_data_path_ + "/logs"; ///< Program Data Location
QString app_data_objs_path_ =
app_data_path_ + "/data_objs"; ///< Object storage path
+ QString app_config_target_path_ =
+ app_config_path_ + "/config.ini"; ///< take effect only in portable mode
+
bool portable_mode_ = false; ///<
QString app_portable_config_path_ =
working_path_ + "/config.ini"; ///< take effect only in portable mode
diff --git a/src/ui/dialog/WaitingDialog.cpp b/src/ui/dialog/WaitingDialog.cpp
index 4b1a908f..87ac0fe5 100644
--- a/src/ui/dialog/WaitingDialog.cpp
+++ b/src/ui/dialog/WaitingDialog.cpp
@@ -48,6 +48,7 @@ WaitingDialog::WaitingDialog(const QString& title, QWidget* parent)
Qt::CustomizeWindowHint);
this->setWindowTitle(title);
this->setAttribute(Qt::WA_DeleteOnClose);
+ this->setFixedSize(240, 42);
this->movePosition2CenterOfParent();
this->show();