Use common code formatting style.
This commit is contained in:
@@ -9,24 +9,29 @@
|
||||
|
||||
#include "GpgMECWorker.h"
|
||||
|
||||
GpgMECWorker::GpgMECWorker() {
|
||||
GpgMECWorker::GpgMECWorker()
|
||||
{
|
||||
gpgme_error_t c_err = gpgme_new(&c_ctx);
|
||||
}
|
||||
|
||||
GpgMECWorker::~GpgMECWorker() {
|
||||
GpgMECWorker::~GpgMECWorker()
|
||||
{
|
||||
gpgme_release(c_ctx);
|
||||
}
|
||||
|
||||
bool GpgMECWorker::DeleteKey(const char * fpr, bool secret, GpgME::Error& e) {
|
||||
bool GpgMECWorker::DeleteKey(const char * fpr, bool secret, GpgME::Error& e)
|
||||
{
|
||||
gpgme_key_t c_key;
|
||||
gpgme_error_t c_err = gpgme_get_key(c_ctx, fpr, &c_key, secret);
|
||||
if (c_key == NULL) {
|
||||
if (c_key == NULL)
|
||||
{
|
||||
e = GpgME::Error::fromCode(c_err);
|
||||
return false;
|
||||
}
|
||||
int flags = secret ? GPGME_DELETE_ALLOW_SECRET | GPGME_DELETE_FORCE : GPGME_DELETE_FORCE;
|
||||
c_err = gpgme_op_delete_ext(c_ctx, c_key, flags);
|
||||
if (c_err != 0) {
|
||||
if (c_err != 0)
|
||||
{
|
||||
e = GpgME::Error::fromCode(c_err);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user