Commit d6cf75cf authored by Sandro Knauß's avatar Sandro Knauß

add isHidden Property for MessageParts

parent 66bc899b
......@@ -587,7 +587,7 @@ public:
KMime::Content *node = mp->mNode;
NodeHelper *nodeHelper = mp->mOtp->nodeHelper();
if (nodeHelper->isNodeDisplayedHidden(node)) {
if (mp->isHidden()) {
return QString();
}
......
......@@ -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)
......
......@@ -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;
......
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