diff options
author | saturneric <[email protected]> | 2023-12-23 06:05:19 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-12-23 06:05:19 +0000 |
commit | f52e49d37e99be3568d20c658633f1e830b53d13 (patch) | |
tree | 2c9dacd56daba7fa19e20ffa91fe293b6edcda1c /src/core/function/gpg/GpgKeyOpera.cpp | |
parent | fix: slove compilation issue on macos (diff) | |
download | GpgFrontend-f52e49d37e99be3568d20c658633f1e830b53d13.tar.gz GpgFrontend-f52e49d37e99be3568d20c658633f1e830b53d13.zip |
fix: gen key test cases typeid rtti issues
Diffstat (limited to 'src/core/function/gpg/GpgKeyOpera.cpp')
-rw-r--r-- | src/core/function/gpg/GpgKeyOpera.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/function/gpg/GpgKeyOpera.cpp b/src/core/function/gpg/GpgKeyOpera.cpp index 3ea9b365..378a946d 100644 --- a/src/core/function/gpg/GpgKeyOpera.cpp +++ b/src/core/function/gpg/GpgKeyOpera.cpp @@ -47,6 +47,7 @@ #include "core/utils/AsyncUtils.h" #include "core/utils/CommonUtils.h" #include "core/utils/GpgUtils.h" +#include "model/GpgGenerateKeyResult.h" #include "typedef/GpgTypedef.h" namespace GpgFrontend { @@ -197,11 +198,12 @@ void GpgKeyOpera::GenerateKey(const std::shared_ptr<GenKeyInfo>& params, err = gpgme_op_createkey(ctx.DefaultContext(), userid, algo, 0, expires, nullptr, flags); - GpgGenKeyResult result; if (CheckGpgError(err) == GPG_ERR_NO_ERROR) { - result = NewResult(gpgme_op_genkey_result(ctx.DefaultContext())); + data_object->Swap({GpgGenerateKeyResult{ + gpgme_op_genkey_result(ctx.DefaultContext())}}); + } else { + data_object->Swap({GpgGenerateKeyResult{}}); } - data_object->Swap({result}); return CheckGpgError(err); }, |