aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgKeyOpera.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-23 06:05:19 +0000
committersaturneric <[email protected]>2023-12-23 06:05:19 +0000
commitf52e49d37e99be3568d20c658633f1e830b53d13 (patch)
tree2c9dacd56daba7fa19e20ffa91fe293b6edcda1c /src/core/function/gpg/GpgKeyOpera.cpp
parentfix: slove compilation issue on macos (diff)
downloadGpgFrontend-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.cpp8
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);
},