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

Modernize code

GnuPG-bug-id: 5535
parent b2e7699a
......@@ -237,17 +237,13 @@ public:
return true;
}
if (!mWidget->selfKey().isNull()) {
if (!mWidget->selfKey().isNull() || mWidget->encryptSymmetric()) {
return true;
}
bool hasSecret = false;
Q_FOREACH (const Key k, mWidget->recipients()) {
if (k.hasSecret()) {
hasSecret = true;
break;
}
}
if (!hasSecret && !mWidget->encryptSymmetric()) {
const auto recipientKeys = recipients();
const bool hasSecret = std::any_of(std::begin(recipientKeys), std::end(recipientKeys),
[](const auto &k) { return k.hasSecret(); });
if (!hasSecret) {
if (KMessageBox::warningContinueCancel(this,
xi18nc("@info",
"<para>None of the recipients you are encrypting to seems to be your own.</para>"
......
Markdown is supported
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