aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/GpgCoreInit.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-04 13:43:03 +0000
committersaturneric <[email protected]>2023-12-04 13:43:33 +0000
commit33544f343df4e834730d9b0c0916433a51738d55 (patch)
treefdab9c9971e041aacf9ddf4269c3def512c0f627 /src/core/GpgCoreInit.cpp
parentfix: common utils should be created before core initialization (diff)
downloadGpgFrontend-33544f343df4e834730d9b0c0916433a51738d55.tar.gz
GpgFrontend-33544f343df4e834730d9b0c0916433a51738d55.zip
feat: add reasons explanation to env loading failed message box
Diffstat (limited to 'src/core/GpgCoreInit.cpp')
-rw-r--r--src/core/GpgCoreInit.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp
index dcd0dcfb..6d96a50d 100644
--- a/src/core/GpgCoreInit.cpp
+++ b/src/core/GpgCoreInit.cpp
@@ -221,7 +221,8 @@ void InitGpgFrontendCore() {
// initialize library gpgme
if (!InitGpgME()) {
- CoreSignalStation::GetInstance()->SignalBadGnupgEnv();
+ CoreSignalStation::GetInstance()->SignalBadGnupgEnv(
+ _("GpgME inilization failed"));
return;
}
@@ -330,7 +331,8 @@ void InitGpgFrontendCore() {
// exit if failed
if (!ctx.Good()) {
SPDLOG_ERROR("default gnupg context init error, abort");
- CoreSignalStation::GetInstance()->SignalBadGnupgEnv();
+ CoreSignalStation::GetInstance()->SignalBadGnupgEnv(
+ _("GpgME Context inilization failed"));
return -1;
}
Module::UpsertRTValue("core", "env.state.ctx", std::string{"1"});
@@ -376,7 +378,10 @@ void InitGpgFrontendCore() {
Module::UpsertRTValue("core", "env.state.all", std::string{"1"});
}
- GpgKeyGetter::GetInstance().FlushKeyCache();
+ if (!GpgKeyGetter::GetInstance().FlushKeyCache()) {
+ CoreSignalStation::GetInstance()->SignalBadGnupgEnv(
+ _("Gpg Key Detabase inilization failed"));
+ };
SPDLOG_INFO(
"basic env checking finished, including gpgme, ctx, and key "
"infos");