Commit 374b48d1 authored by Sandro Knauß's avatar Sandro Knauß

cryptoProtocoll is handeld inside the messageparts and not in otp

parent e037f581
......@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(MESSAGELIB_LIB_VERSION "5.2.47")
set(MESSAGELIB_LIB_VERSION "5.2.48")
set(KF5_VERSION "5.19.0")
set(KDEPIMLIBS_LIB_VERSION "5.2.40")
......
......@@ -965,7 +965,7 @@ void ViewerPrivate::parseContent(KMime::Content *content)
mNodeHelper->removeTempFiles();
mNodeHelper->setNodeUnprocessed(mMessage.data(), true);
MailViewerSource otpSource(this);
MimeTreeParser::ObjectTreeParser otp(&otpSource, mNodeHelper, 0, mMessage.data() != content /* show only single node */);
MimeTreeParser::ObjectTreeParser otp(&otpSource, mNodeHelper, mMessage.data() != content /* show only single node */);
otp.setAllowAsync(!mPrinting);
otp.setPrinting(mPrinting);
otp.parseObjectTree(content);
......
......@@ -1103,7 +1103,7 @@ void MessagePart::html(bool decorate)
const HTMLBlock::Ptr aBlock(attachmentBlock());
const CryptoBlock block(mOtp->htmlWriter(), &mMetaData, mOtp->nodeHelper(), mOtp->cryptoProtocol(), mOtp->mSource, QString(), Q_NULLPTR);
const CryptoBlock block(mOtp->htmlWriter(), &mMetaData, mOtp->nodeHelper(), Q_NULLPTR, mOtp->mSource, QString(), Q_NULLPTR);
writer->queue(mOtp->quotedHTML(text(), decorate));
}
......@@ -1272,10 +1272,6 @@ void TextMessagePart::parseContent()
if (!blocks.isEmpty()) {
if (blocks.count() > 1 || blocks.at(0).type() != MimeTreeParser::NoPgpBlock) {
mOtp->setCryptoProtocol(cryptProto);
}
/* The (overall) signature/encrypted status is broken
* if one unencrypted part is at the beginning or in the middle
* because mailmain adds an unencrypted part at the end this should not break the overall status
......@@ -1641,28 +1637,6 @@ QString CertMessagePart::text() const
return QString();
}
// A small class that eases temporary CryptPlugWrapper changes:
class CryptoProtocolSaver
{
ObjectTreeParser *otp;
const Kleo::CryptoBackend::Protocol *protocol;
public:
CryptoProtocolSaver(ObjectTreeParser *_otp, const Kleo::CryptoBackend::Protocol *_w)
: otp(_otp), protocol(_otp ? _otp->cryptoProtocol() : 0)
{
if (otp) {
otp->setCryptoProtocol(_w);
}
}
~CryptoProtocolSaver()
{
if (otp) {
otp->setCryptoProtocol(protocol);
}
}
};
//-----CryptMessageBlock---------------------
CryptoMessagePart::CryptoMessagePart(ObjectTreeParser *otp,
const QString &text,
......@@ -1852,7 +1826,6 @@ void CryptoMessagePart::startDecryption(KMime::Content *data)
mMetaData.isEncrypted = true;
CryptoProtocolSaver saver(mOtp, mCryptoProto);
bool bOkDecrypt = okDecryptMIME(*data);
if (mMetaData.inProgress) {
......@@ -1905,7 +1878,6 @@ void CryptoMessagePart::startVerificationDetached(const QByteArray &text, KMime:
mMetaData.isEncrypted = false;
mMetaData.isDecryptable = false;
CryptoProtocolSaver saver(mOtp, mCryptoProto);
mOtp->okVerify(text, mCryptoProto, mMetaData, mVerifiedText, mSignatures, signature, mNode);
if (mMetaData.isSigned) {
......
......@@ -60,7 +60,6 @@
#include <MessageCore/StringUtil>
#include <Libkleo/SpecialJob>
#include <Libkleo/CryptoBackendFactory>
#include <Libkleo/DecryptVerifyJob>
#include <Libkleo/VerifyDetachedJob>
#include <Libkleo/VerifyOpaqueJob>
#include <Libkleo/KeyListJob>
......@@ -105,7 +104,6 @@ ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser *topLevelParser,
mNodeHelper(topLevelParser->mNodeHelper),
mHtmlWriter(topLevelParser->mHtmlWriter),
mTopLevelContent(topLevelParser->mTopLevelContent),
mCryptoProtocol(topLevelParser->mCryptoProtocol),
mShowOnlyOneMimePart(showOnlyOneMimePart),
mHasPendingAsyncJobs(false),
mAllowAsync(topLevelParser->mAllowAsync),
......@@ -117,14 +115,12 @@ ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser *topLevelParser,
ObjectTreeParser::ObjectTreeParser(ObjectTreeSourceIf *source,
MimeTreeParser::NodeHelper *nodeHelper,
const Kleo::CryptoBackend::Protocol *protocol,
bool showOnlyOneMimePart,
const AttachmentStrategy *strategy)
: mSource(source),
mNodeHelper(nodeHelper),
mHtmlWriter(0),
mTopLevelContent(0),
mCryptoProtocol(protocol),
mShowOnlyOneMimePart(showOnlyOneMimePart),
mHasPendingAsyncJobs(false),
mAllowAsync(false),
......@@ -154,7 +150,6 @@ ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser &other)
mNodeHelper(other.nodeHelper()), //TODO(Andras) hm, review what happens if mDeleteNodeHelper was true in the source
mHtmlWriter(other.mHtmlWriter),
mTopLevelContent(other.mTopLevelContent),
mCryptoProtocol(other.cryptoProtocol()),
mShowOnlyOneMimePart(other.showOnlyOneMimePart()),
mHasPendingAsyncJobs(other.hasPendingAsyncJobs()),
mAllowAsync(other.allowAsync()),
......@@ -1552,16 +1547,6 @@ QByteArray ObjectTreeParser::htmlContentCharset() const
return mHtmlContentCharset;
}
void ObjectTreeParser::setCryptoProtocol(const Kleo::CryptoBackend::Protocol *protocol)
{
mCryptoProtocol = protocol;
}
const Kleo::CryptoBackend::Protocol *ObjectTreeParser::cryptoProtocol() const
{
return mCryptoProtocol;
}
bool ObjectTreeParser::showOnlyOneMimePart() const
{
return mShowOnlyOneMimePart;
......
......@@ -288,7 +288,6 @@ class MIMETREEPARSER_EXPORT ObjectTreeParser
public:
explicit ObjectTreeParser(ObjectTreeSourceIf *source,
NodeHelper *nodeHelper = 0,
const Kleo::CryptoBackend::Protocol *protocol = Q_NULLPTR,
bool showOneMimePart = false,
const AttachmentStrategy *attachmentStrategy = Q_NULLPTR);
......@@ -326,9 +325,6 @@ public:
QByteArray plainTextContentCharset() const;
QByteArray htmlContentCharset() const;
void setCryptoProtocol(const Kleo::CryptoBackend::Protocol *protocol);
const Kleo::CryptoBackend::Protocol *cryptoProtocol() const;
bool showOnlyOneMimePart() const;
void setShowOnlyOneMimePart(bool show);
......@@ -418,7 +414,6 @@ private:
QString mPlainTextContent;
QString mHtmlContent;
KMime::Content *mTopLevelContent;
const Kleo::CryptoBackend::Protocol *mCryptoProtocol;
/// Show only one mime part means that the user has selected some node in the message structure
/// viewer that is not the root, which means the user wants to only see the selected node and its
......
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