Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
PIM Messagelib
Commits
374b48d1
Commit
374b48d1
authored
Mar 30, 2016
by
Sandro Knauß
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptoProtocoll is handeld inside the messageparts and not in otp
parent
e037f581
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
51 deletions
+3
-51
CMakeLists.txt
CMakeLists.txt
+1
-1
messageviewer/src/viewer/viewer_p.cpp
messageviewer/src/viewer/viewer_p.cpp
+1
-1
mimetreeparser/src/viewer/messagepart.cpp
mimetreeparser/src/viewer/messagepart.cpp
+1
-29
mimetreeparser/src/viewer/objecttreeparser.cpp
mimetreeparser/src/viewer/objecttreeparser.cpp
+0
-15
mimetreeparser/src/viewer/objecttreeparser.h
mimetreeparser/src/viewer/objecttreeparser.h
+0
-5
No files found.
CMakeLists.txt
View file @
374b48d1
...
...
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include
(
ECMQtDeclareLoggingCategory
)
include
(
ECMAddTests
)
set
(
MESSAGELIB_LIB_VERSION
"5.2.4
7
"
)
set
(
MESSAGELIB_LIB_VERSION
"5.2.4
8
"
)
set
(
KF5_VERSION
"5.19.0"
)
set
(
KDEPIMLIBS_LIB_VERSION
"5.2.40"
)
...
...
messageviewer/src/viewer/viewer_p.cpp
View file @
374b48d1
...
...
@@ -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
);
...
...
mimetreeparser/src/viewer/messagepart.cpp
View file @
374b48d1
...
...
@@ -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
)
{
...
...
mimetreeparser/src/viewer/objecttreeparser.cpp
View file @
374b48d1
...
...
@@ -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
;
...
...
mimetreeparser/src/viewer/objecttreeparser.h
View file @
374b48d1
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment