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