summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <[email protected]>2016-06-09 14:30:12 +0200
committerSandro Knauß <[email protected]>2016-06-09 14:31:36 +0200
commitd6cf75cfeaedd983a82ebaa6aaaedc5349b47b7a (patch)
tree095f013508f3e2bd038a2472ae81b57b43c77126
parent66bc899bedc06c4c1ef9ab7cfdc95a3548d10d42 (diff)
add isHidden Property for MessageParts
-rw-r--r--messageviewer/src/messagepartthemes/default/defaultrenderer.cpp2
-rw-r--r--mimetreeparser/src/viewer/messagepart.cpp13
-rw-r--r--mimetreeparser/src/viewer/messagepart.h5
3 files changed, 19 insertions, 1 deletions
diff --git a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
index 2456c38..7044641 100644
--- a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
+++ b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
@@ -587,7 +587,7 @@ public:
KMime::Content *node = mp->mNode;
NodeHelper *nodeHelper = mp->mOtp->nodeHelper();
- if (nodeHelper->isNodeDisplayedHidden(node)) {
+ if (mp->isHidden()) {
return QString();
}
diff --git a/mimetreeparser/src/viewer/messagepart.cpp b/mimetreeparser/src/viewer/messagepart.cpp
index 5b46e09..550b19d 100644
--- a/mimetreeparser/src/viewer/messagepart.cpp
+++ b/mimetreeparser/src/viewer/messagepart.cpp
@@ -111,6 +111,11 @@ bool MessagePart::isHtml() const
return false;
}
+bool MessagePart::isHidden() const
+{
+ return false;
+}
+
CSSHelperBase *MessagePart::cssHelper() const
{
Q_ASSERT(mOtp);
@@ -228,12 +233,15 @@ TextMessagePart::TextMessagePart(ObjectTreeParser *otp, KMime::Content *node, bo
, mShowLink(showLink)
, mDecryptMessage(decryptMessage)
, mAsIcon(asIcon)
+ , mIsHidden(false)
{
if (!mNode) {
qCWarning(MIMETREEPARSER_LOG) << "not a valid node";
return;
}
+ mIsHidden = mOtp->nodeHelper()->isNodeDisplayedHidden(mNode);
+
parseContent();
}
@@ -336,6 +344,11 @@ KMMsgSignatureState TextMessagePart::signatureState() const
return mSignatureState;
}
+bool TextMessagePart::isHidden() const
+{
+ return mIsHidden;
+}
+
//-----HtmlMessageBlock----------------------
HtmlMessagePart::HtmlMessagePart(ObjectTreeParser *otp, KMime::Content *node, Interface::ObjectTreeSource *source)
diff --git a/mimetreeparser/src/viewer/messagepart.h b/mimetreeparser/src/viewer/messagepart.h
index 5d5a407..e1bc469 100644
--- a/mimetreeparser/src/viewer/messagepart.h
+++ b/mimetreeparser/src/viewer/messagepart.h
@@ -64,6 +64,7 @@ class MIMETREEPARSER_EXPORT MessagePart : public Interface::MessagePart
Q_PROPERTY(bool attachment READ isAttachment)
Q_PROPERTY(bool root READ isRoot)
Q_PROPERTY(bool isHtml READ isHtml)
+ Q_PROPERTY(bool isHidden READ isHidden)
public:
typedef QSharedPointer<MessagePart> Ptr;
MessagePart(ObjectTreeParser *otp,
@@ -80,6 +81,7 @@ public:
bool isRoot() const;
virtual bool isHtml() const;
+ virtual bool isHidden() const;
PartMetaData *partMetaData();
@@ -167,6 +169,8 @@ public:
bool decryptMessage() const;
+ bool isHidden() const Q_DECL_OVERRIDE;
+
private:
void parseContent();
@@ -176,6 +180,7 @@ private:
bool mDrawFrame;
bool mShowLink;
bool mDecryptMessage;
+ bool mIsHidden;
IconType mAsIcon;
friend class DefaultRendererPrivate;