diff options
-rw-r--r-- | components/mailviewer/qml/main.qml | 15 | ||||
-rw-r--r-- | framework/src/file.cpp | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/components/mailviewer/qml/main.qml b/components/mailviewer/qml/main.qml index e69dd5a2..6de7e910 100644 --- a/components/mailviewer/qml/main.qml +++ b/components/mailviewer/qml/main.qml | |||
@@ -17,14 +17,25 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 |
20 | import QtQuick.Controls 2.0 as Controls2 | 20 | import QtQuick.Controls 2.0 |
21 | import org.kube.framework 1.0 as Kube | ||
21 | 22 | ||
22 | Controls2.ApplicationWindow { | 23 | ApplicationWindow { |
23 | id: app | 24 | id: app |
24 | height: 900 | 25 | height: 900 |
25 | width: 1500 | 26 | width: 1500 |
26 | 27 | ||
28 | Kube.File { | ||
29 | id: file | ||
30 | path: "/build/kube/message.mime" | ||
31 | } | ||
32 | Kube.MessageParser { | ||
33 | id: messageParser | ||
34 | message: file.data | ||
35 | } | ||
36 | |||
27 | MailViewer { | 37 | MailViewer { |
28 | visible: true | 38 | visible: true |
39 | model: messageParser.parts | ||
29 | } | 40 | } |
30 | } | 41 | } |
diff --git a/framework/src/file.cpp b/framework/src/file.cpp index b2a19c23..a57b3a38 100644 --- a/framework/src/file.cpp +++ b/framework/src/file.cpp | |||
@@ -36,7 +36,7 @@ QString File::data() | |||
36 | 36 | ||
37 | QString File::read(const QString &path) | 37 | QString File::read(const QString &path) |
38 | { | 38 | { |
39 | QFile file(QDir::homePath() + "/" + path); | 39 | QFile file(QDir::isAbsolutePath(path) ? path : QDir::homePath() + "/" + path); |
40 | if (file.open(QIODevice::ReadOnly)) { | 40 | if (file.open(QIODevice::ReadOnly)) { |
41 | return file.readAll(); | 41 | return file.readAll(); |
42 | } | 42 | } |