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/function/gpg/GpgKeyGetter.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/function/gpg/GpgKeyGetter.cpp')
-rw-r--r-- | src/core/function/gpg/GpgKeyGetter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/function/gpg/GpgKeyGetter.cpp b/src/core/function/gpg/GpgKeyGetter.cpp index a60b66c9..0cd6741c 100644 --- a/src/core/function/gpg/GpgKeyGetter.cpp +++ b/src/core/function/gpg/GpgKeyGetter.cpp @@ -87,7 +87,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> { return keys_list; } - void FlushKeyCache() { + auto FlushKeyCache() -> bool { SPDLOG_DEBUG("flush key channel called, channel: {}", GetChannel()); // clear the keys cache @@ -100,7 +100,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> { assert(CheckGpgError(err) == GPG_ERR_NO_ERROR); // return when error - if (CheckGpgError(err) != GPG_ERR_NO_ERROR) return; + if (CheckGpgError(err) != GPG_ERR_NO_ERROR) return false; { // get the lock @@ -131,6 +131,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> { assert(CheckGpgError2ErrCode(err, GPG_ERR_EOF) == GPG_ERR_NO_ERROR); SPDLOG_DEBUG("flush key channel done, channel: {}", GetChannel()); + return true; } auto GetKeys(const KeyIdArgsListPtr& ids) -> KeyListPtr { @@ -217,7 +218,7 @@ auto GpgKeyGetter::GetPubkey(const std::string& key_id, bool use_cache) return p_->GetPubkey(key_id, use_cache); } -void GpgKeyGetter::FlushKeyCache() { p_->FlushKeyCache(); } +auto GpgKeyGetter::FlushKeyCache() -> bool { return p_->FlushKeyCache(); } auto GpgKeyGetter::GetKeys(const KeyIdArgsListPtr& ids) -> KeyListPtr { return p_->GetKeys(ids); |