diff options
author | Saturneric <[email protected]> | 2023-07-13 03:02:28 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-07-13 03:02:28 +0000 |
commit | 5b635cf78c679f36cf47d18d8ba4e6967a7297f9 (patch) | |
tree | cbe42823440bcadd39572c4c19dee66d8d8c5b1e /src/core/model/GpgKey.cpp | |
parent | feat: support owner trust level settings of gpg key (diff) | |
download | GpgFrontend-5b635cf78c679f36cf47d18d8ba4e6967a7297f9.tar.gz GpgFrontend-5b635cf78c679f36cf47d18d8ba4e6967a7297f9.zip |
feat: improve ui of owner trust function
Diffstat (limited to 'src/core/model/GpgKey.cpp')
-rw-r--r-- | src/core/model/GpgKey.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/model/GpgKey.cpp b/src/core/model/GpgKey.cpp index e2e7df6e..3a167b81 100644 --- a/src/core/model/GpgKey.cpp +++ b/src/core/model/GpgKey.cpp @@ -93,6 +93,24 @@ std::string GpgFrontend::GpgKey::GetOwnerTrust() const { return "Invalid"; } +int GpgFrontend::GpgKey::GetOwnerTrustLevel() const { + switch (key_ref_->owner_trust) { + case GPGME_VALIDITY_UNKNOWN: + return 0; + case GPGME_VALIDITY_UNDEFINED: + return 1; + case GPGME_VALIDITY_NEVER: + return 2; + case GPGME_VALIDITY_MARGINAL: + return 3; + case GPGME_VALIDITY_FULL: + return 4; + case GPGME_VALIDITY_ULTIMATE: + return 5; + } + return 0; +} + std::string GpgFrontend::GpgKey::GetPublicKeyAlgo() const { return gpgme_pubkey_algo_name(key_ref_->subkeys->pubkey_algo); } |