From dd582091bc72ddf61a66d2bc3a3e0ce47f2296b5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 1 May 2017 22:42:49 +0200 Subject: Mailviewer --- framework/qml/MailViewer.qml | 10 +++++----- framework/src/domain/messageparser.cpp | 5 +++++ framework/src/domain/messageparser.h | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'framework') diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index 487da576..01f78fb9 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml @@ -26,21 +26,23 @@ import org.kube.framework 1.0 as Kube Item { id: root property variant message; - property string html; property int desiredHeight: mailViewer.height + 20 - property variant attachments + property variant attachments: messageParser.attachments clip: true MV.MailViewer { + anchors.top: root.top id: mailViewer + model: messageParser.newTree debug: false width: parent.width } Controls1.TreeView { id: mailStructure - anchors.top: messageParser.attachments.rowCount() > 0 ? attachments.bottom : mailViewer.bottom + // anchors.fill: parent + // anchors.top: root.attachments.rowCount() > 0 ? attachments.bottom : mailViewer.bottom visible: mailViewer.debug width: parent.width height: 400 @@ -71,6 +73,4 @@ Item { id: messageParser message: root.message } - attachments: messageParser.attachments - html: messageParser.html } diff --git a/framework/src/domain/messageparser.cpp b/framework/src/domain/messageparser.cpp index ea2ecbf1..46ffe79d 100644 --- a/framework/src/domain/messageparser.cpp +++ b/framework/src/domain/messageparser.cpp @@ -62,6 +62,11 @@ QString MessageParser::html() const return d->mHtml; } +bool MessageParser::isSimpleHtml() const +{ + return d->mHtml.contains("foobar"); +} + QVariant MessageParser::message() const { return QVariant(); diff --git a/framework/src/domain/messageparser.h b/framework/src/domain/messageparser.h index aeeed93c..2c4febaf 100644 --- a/framework/src/domain/messageparser.h +++ b/framework/src/domain/messageparser.h @@ -48,6 +48,7 @@ class MessageParser : public QObject Q_OBJECT Q_PROPERTY (QVariant message READ message WRITE setMessage) Q_PROPERTY (QString html READ html NOTIFY htmlChanged) + Q_PROPERTY (bool isSimpleHtml READ isSimpleHtml NOTIFY htmlChanged) Q_PROPERTY (QAbstractItemModel* partTree READ partTree NOTIFY htmlChanged) Q_PROPERTY (QAbstractItemModel* newTree READ newTree NOTIFY htmlChanged) Q_PROPERTY (QAbstractItemModel* attachments READ attachments NOTIFY htmlChanged) @@ -57,6 +58,7 @@ public: ~MessageParser(); QString html() const; + bool isSimpleHtml() const; QVariant message() const; void setMessage(const QVariant &to); -- cgit v1.2.3