diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-01 22:42:49 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-02 10:03:57 +0200 |
commit | dd582091bc72ddf61a66d2bc3a3e0ce47f2296b5 (patch) | |
tree | 87c75371e5076b70c9cc09157f4cb88ca45a4ad2 /framework | |
parent | 4e416d546a68513f05ef10d41d05e0a9c6d5ecf6 (diff) | |
download | kube-dd582091bc72ddf61a66d2bc3a3e0ce47f2296b5.tar.gz kube-dd582091bc72ddf61a66d2bc3a3e0ce47f2296b5.zip |
Mailviewer
Diffstat (limited to 'framework')
-rw-r--r-- | framework/qml/MailViewer.qml | 10 | ||||
-rw-r--r-- | framework/src/domain/messageparser.cpp | 5 | ||||
-rw-r--r-- | framework/src/domain/messageparser.h | 2 |
3 files changed, 12 insertions, 5 deletions
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 | |||
26 | Item { | 26 | Item { |
27 | id: root | 27 | id: root |
28 | property variant message; | 28 | property variant message; |
29 | property string html; | ||
30 | property int desiredHeight: mailViewer.height + 20 | 29 | property int desiredHeight: mailViewer.height + 20 |
31 | property variant attachments | 30 | property variant attachments: messageParser.attachments |
32 | 31 | ||
33 | clip: true | 32 | clip: true |
34 | 33 | ||
35 | MV.MailViewer { | 34 | MV.MailViewer { |
35 | anchors.top: root.top | ||
36 | id: mailViewer | 36 | id: mailViewer |
37 | model: messageParser.newTree | ||
37 | debug: false | 38 | debug: false |
38 | width: parent.width | 39 | width: parent.width |
39 | } | 40 | } |
40 | 41 | ||
41 | Controls1.TreeView { | 42 | Controls1.TreeView { |
42 | id: mailStructure | 43 | id: mailStructure |
43 | anchors.top: messageParser.attachments.rowCount() > 0 ? attachments.bottom : mailViewer.bottom | 44 | // anchors.fill: parent |
45 | // anchors.top: root.attachments.rowCount() > 0 ? attachments.bottom : mailViewer.bottom | ||
44 | visible: mailViewer.debug | 46 | visible: mailViewer.debug |
45 | width: parent.width | 47 | width: parent.width |
46 | height: 400 | 48 | height: 400 |
@@ -71,6 +73,4 @@ Item { | |||
71 | id: messageParser | 73 | id: messageParser |
72 | message: root.message | 74 | message: root.message |
73 | } | 75 | } |
74 | attachments: messageParser.attachments | ||
75 | html: messageParser.html | ||
76 | } | 76 | } |
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 | |||
62 | return d->mHtml; | 62 | return d->mHtml; |
63 | } | 63 | } |
64 | 64 | ||
65 | bool MessageParser::isSimpleHtml() const | ||
66 | { | ||
67 | return d->mHtml.contains("foobar"); | ||
68 | } | ||
69 | |||
65 | QVariant MessageParser::message() const | 70 | QVariant MessageParser::message() const |
66 | { | 71 | { |
67 | return QVariant(); | 72 | 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 | |||
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | Q_PROPERTY (QVariant message READ message WRITE setMessage) | 49 | Q_PROPERTY (QVariant message READ message WRITE setMessage) |
50 | Q_PROPERTY (QString html READ html NOTIFY htmlChanged) | 50 | Q_PROPERTY (QString html READ html NOTIFY htmlChanged) |
51 | Q_PROPERTY (bool isSimpleHtml READ isSimpleHtml NOTIFY htmlChanged) | ||
51 | Q_PROPERTY (QAbstractItemModel* partTree READ partTree NOTIFY htmlChanged) | 52 | Q_PROPERTY (QAbstractItemModel* partTree READ partTree NOTIFY htmlChanged) |
52 | Q_PROPERTY (QAbstractItemModel* newTree READ newTree NOTIFY htmlChanged) | 53 | Q_PROPERTY (QAbstractItemModel* newTree READ newTree NOTIFY htmlChanged) |
53 | Q_PROPERTY (QAbstractItemModel* attachments READ attachments NOTIFY htmlChanged) | 54 | Q_PROPERTY (QAbstractItemModel* attachments READ attachments NOTIFY htmlChanged) |
@@ -57,6 +58,7 @@ public: | |||
57 | ~MessageParser(); | 58 | ~MessageParser(); |
58 | 59 | ||
59 | QString html() const; | 60 | QString html() const; |
61 | bool isSimpleHtml() const; | ||
60 | 62 | ||
61 | QVariant message() const; | 63 | QVariant message() const; |
62 | void setMessage(const QVariant &to); | 64 | void setMessage(const QVariant &to); |