diff options
author | Saturneric <[email protected]> | 2023-04-05 08:48:32 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-04-05 08:48:32 +0000 |
commit | cd24624e94551193f9e541e69642e84e89999f78 (patch) | |
tree | 2595a7bf86231991bbf1ea2104aad816286a2365 /src/core/GpgCoreInit.cpp | |
parent | fix: solve custom gpgconf path wrong issue (diff) | |
download | GpgFrontend-cd24624e94551193f9e541e69642e84e89999f78.tar.gz GpgFrontend-cd24624e94551193f9e541e69642e84e89999f78.zip |
feat: add check for key db and improve ui
Diffstat (limited to 'src/core/GpgCoreInit.cpp')
-rw-r--r-- | src/core/GpgCoreInit.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp index 243dfb5e..6d782439 100644 --- a/src/core/GpgCoreInit.cpp +++ b/src/core/GpgCoreInit.cpp @@ -163,6 +163,19 @@ void init_gpgfrontend_core() { custom_gnupg_install_fs_path.u8string()); } + // check key database path + std::filesystem::path custom_key_database_fs_path = custom_key_database_path; + if (!custom_key_database_fs_path.is_absolute() || + !std::filesystem::exists(custom_key_database_fs_path) || + !std::filesystem::is_directory(custom_key_database_fs_path)) { + use_custom_key_database_path = false; + SPDLOG_ERROR("core loaded custom gpg key database is illegal: {}", + custom_key_database_fs_path.u8string()); + } else { + SPDLOG_DEBUG("core loaded custom gpg key database path: {}", + custom_key_database_fs_path.u8string()); + } + // init default channel auto& default_ctx = GpgFrontend::GpgContext::CreateInstance( GPGFRONTEND_DEFAULT_CHANNEL, [=]() -> std::unique_ptr<ChannelObject> { |