summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/mailviewer/qml/main.qml15
-rw-r--r--framework/src/file.cpp2
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
19import QtQuick 2.7 19import QtQuick 2.7
20import QtQuick.Controls 2.0 as Controls2 20import QtQuick.Controls 2.0
21import org.kube.framework 1.0 as Kube
21 22
22Controls2.ApplicationWindow { 23ApplicationWindow {
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
37QString File::read(const QString &path) 37QString 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 }