diff options
author | saturneric <[email protected]> | 2023-12-04 13:43:03 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-12-04 13:43:33 +0000 |
commit | 33544f343df4e834730d9b0c0916433a51738d55 (patch) | |
tree | fdab9c9971e041aacf9ddf4269c3def512c0f627 /src/core/GpgCoreInit.cpp | |
parent | fix: common utils should be created before core initialization (diff) | |
download | GpgFrontend-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.cpp | 11 |
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"); |