Commit 0d5518ff authored by Sandro Knauß's avatar Sandro Knauß
Browse files

[Fix] KMComposerWin: Update encryption state when changing identities.

If we are in auto encryption mode, we need to retrigger the calulation
of the encryption state, as it is false by default. And will be
reenabled, if we have keys for every recipient.
parent be7d2b33
......@@ -221,7 +221,6 @@ void KMComposerWinTest::testChangeIdentity()
QTimer::singleShot(50, &loop, SLOT(quit()));
loop.exec();
QCoreApplication::processEvents(QEventLoop::AllEvents);
QEXPECT_FAIL("", "Encryption state is not update correctly.", Continue);
QCOMPARE(encryption->isVisible(), true);
QCOMPARE(signature->isVisible(), true);
}
......
......@@ -3327,6 +3327,15 @@ void KMComposerWin::updateComposerAfterIdentityChanged(const KIdentityManagement
// make sure the From and BCC fields are shown if necessary
rethinkFields(false);
setModified(wasModified);
// Update encryption status of all recipients, if encryption state is not set by user
const bool setByUser = mEncryptAction->property("setByUser").toBool();
if (!setByUser && ident.pgpAutoEncrypt()) {
const auto lst = mComposerBase->recipientsEditor()->lines();
for (auto line : lst) {
slotRecipientAdded(qobject_cast<MessageComposer::RecipientLineNG *>(line));
}
}
}
void KMComposerWin::slotSpellcheckConfig()
......
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