Commit 92dba369 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Use isDeVs() instead of IS_DE_VS macro

The different isDeVs() member functions exist since GpgME 1.10. We
require 1.16.
parent a304d9fb
Pipeline #197364 passed with stage
in 4 minutes and 39 seconds
......@@ -273,7 +273,7 @@ static QString formatSigningInformation(const Signature &sig)
if (Kleo::gnupgIsDeVsCompliant()) {
text +=
(QStringLiteral("<br/>")
+ (IS_DE_VS(sig)
+ (sig.isDeVs()
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"The signature is %1", Formatting::deVsString())
: i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
......@@ -575,7 +575,7 @@ static QString formatDecryptionResultDetails(const DecryptionResult &res, const
QString details;
if (Kleo::gnupgIsDeVsCompliant()) {
details += ((IS_DE_VS(res)
details += ((res.isDeVs()
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"The decryption is %1.", Formatting::deVsString())
: i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
......
......@@ -256,14 +256,14 @@ private:
// Handle compliance
bool de_vs = true;
for (const auto &key: q->resolvedSigningKeys()) {
if (!IS_DE_VS(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
if (!key.isDeVs() || keyValidity(key) < GpgME::UserID::Validity::Full) {
de_vs = false;
break;
}
}
if (de_vs) {
for (const auto &key: q->resolvedEncryptionKeys()) {
if (!IS_DE_VS(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
if (!key.isDeVs() || keyValidity(key) < GpgME::UserID::Validity::Full) {
de_vs = false;
break;
}
......
......@@ -460,17 +460,17 @@ std::vector<Key> SignEncryptWidget::recipients() const
bool SignEncryptWidget::isDeVsAndValid() const
{
if (!signKey().isNull()
&& (!IS_DE_VS(signKey()) || keyValidity(signKey()) < GpgME::UserID::Validity::Full)) {
&& (!signKey().isDeVs() || keyValidity(signKey()) < GpgME::UserID::Validity::Full)) {
return false;
}
if (!selfKey().isNull()
&& (!IS_DE_VS(selfKey()) || keyValidity(selfKey()) < GpgME::UserID::Validity::Full)) {
&& (!selfKey().isDeVs() || keyValidity(selfKey()) < GpgME::UserID::Validity::Full)) {
return false;
}
for (const auto &key: recipients()) {
if (!IS_DE_VS(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
if (!key.isDeVs() || keyValidity(key) < GpgME::UserID::Validity::Full) {
return false;
}
}
......
......@@ -172,7 +172,7 @@ static bool is_de_vs_compliant(bool sign, bool encrypt, const std::vector<Sender
if (sign) {
for (const auto &sender: senders) {
const auto &key = sender.resolvedSigningKey(presetProtocol);
if (!IS_DE_VS(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
if (!key.isDeVs() || keyValidity(key) < GpgME::UserID::Validity::Full) {
return false;
}
}
......@@ -181,14 +181,14 @@ static bool is_de_vs_compliant(bool sign, bool encrypt, const std::vector<Sender
if (encrypt) {
for (const auto &sender: senders) {
const auto &key = sender.resolvedSigningKey(presetProtocol);
if (!IS_DE_VS(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
if (!key.isDeVs() || keyValidity(key) < GpgME::UserID::Validity::Full) {
return false;
}
}
for (const auto &recipient: recipients) {
const auto &key = recipient.resolvedEncryptionKey(presetProtocol);
if (!IS_DE_VS(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
if (!key.isDeVs() || keyValidity(key) < GpgME::UserID::Validity::Full) {
return false;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment