Commit f804bfed authored by Sandro Knauß's avatar Sandro Knauß 🐝
Browse files

care about override warnings.

the warning warn unencrypted/unsigned is possible to override in
identity.
parent bd355f25
Pipeline #252658 canceled with stage
in 1 minute and 10 seconds
......@@ -24,7 +24,7 @@ set(AKONADICONTACT_LIB_VERSION "5.21.40")
set(AKONADI_VERSION "5.21.40")
set(GRANTLEETHEME_LIB_VERSION "5.21.40")
set(GRAVATAR_LIB_VERSION "5.21.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.21.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.21.41")
set(KMAILTRANSPORT_LIB_VERSION "5.21.40")
set(KMBOX_LIB_VERSION "5.21.40")
set(KMIME_LIB_VERSION "5.21.40")
......
......@@ -610,6 +610,22 @@ inline bool showKeyApprovalDialog()
{
return MessageComposer::MessageComposerSettings::self()->cryptoShowKeysForApproval();
}
inline bool cryptoWarningUnsigned(const KIdentityManagement::Identity &identity)
{
if (identity.encryptionOverride()) {
return identity.warnNotSign();
}
return MessageComposer::MessageComposerSettings::self()->cryptoWarningUnsigned();
}
inline bool cryptoWarningUnencrypted(const KIdentityManagement::Identity &identity)
{
if (identity.encryptionOverride()) {
return identity.warnNotEncrypt();
}
return MessageComposer::MessageComposerSettings::self()->cryptoWarningUnencrypted();
}
} // nameless namespace
bool ComposerViewBase::addKeysToContext(const QString &gnupgHome,
......@@ -2055,7 +2071,7 @@ bool ComposerViewBase::determineWhetherToSign(bool doSignCompletely, Kleo::KeyRe
}
if (!sign || !doSignCompletely) {
if (MessageComposer::MessageComposerSettings::self()->cryptoWarningUnsigned()) {
if (cryptoWarningUnsigned(currentIdentity())) {
KCursorSaver saver(Qt::WaitCursor);
const QString msg = sign && !doSignCompletely ? i18n(
"Some parts of this message will not be signed.\n"
......@@ -2231,7 +2247,7 @@ bool ComposerViewBase::determineWhetherToEncrypt(bool doEncryptCompletely,
}
if (!encrypt || !doEncryptCompletely) {
if (MessageComposer::MessageComposerSettings::self()->cryptoWarningUnencrypted()) {
if (cryptoWarningUnencrypted(currentIdentity())) {
KCursorSaver saver(Qt::WaitCursor);
const QString msg = !doEncryptCompletely ? i18n(
"Some parts of this message will not be encrypted.\n"
......
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