summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--accounts/imap/package/contents/ui/ImapAccountSettings.qml31
-rw-r--r--accounts/imap/tests/settingstest.cpp4
-rw-r--r--accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml31
-rw-r--r--accounts/maildir/package/contents/ui/MaildirAccountSettings.qml31
-rw-r--r--accounts/maildir/tests/settingstest.cpp4
-rw-r--r--components/mail/contents/ui/main.qml34
-rw-r--r--components/mailviewer/qml/EmbededPart.qml54
-rw-r--r--components/mailviewer/qml/EncryptedPart.qml (renamed from framework/theme/colorpalette.cpp)40
-rw-r--r--components/mailviewer/qml/HtmlPart.qml48
-rw-r--r--components/mailviewer/qml/MailModel.qml50
-rw-r--r--components/mailviewer/qml/MailModel2.qml (renamed from framework/theme/themeplugin.h)19
-rw-r--r--components/mailviewer/qml/MailPart.qml82
-rw-r--r--components/mailviewer/qml/SignedPart.qml (renamed from framework/theme/unit.h)34
-rw-r--r--components/mailviewer/qml/TextPart.qml (renamed from framework/theme/unit.cpp)17
-rw-r--r--components/mailviewer/qml/dummyapp.qml90
-rw-r--r--components/mailviewer/qml/securitybordersGRAY.pngbin0 -> 734 bytes
-rw-r--r--components/mailviewer/qml/securitybordersGREEN.pngbin0 -> 725 bytes
-rw-r--r--components/mailviewer/qml/securitybordersRED.pngbin0 -> 725 bytes
-rw-r--r--components/mailviewer/qml/securitybordersYELLOW.pngbin0 -> 735 bytes
-rw-r--r--components/package/contents/ui/AccountSwitcher.qml33
-rw-r--r--components/package/contents/ui/Avatar.qml31
-rw-r--r--components/package/contents/ui/Composer.qml31
-rw-r--r--components/package/contents/ui/ContentView.qml18
-rw-r--r--components/package/contents/ui/EditAccountDialog.qml31
-rw-r--r--components/package/contents/ui/FocusComposer.qml31
-rw-r--r--components/package/contents/ui/FolderListView.qml31
-rw-r--r--components/package/contents/ui/ListItem.qml31
-rw-r--r--components/package/contents/ui/MailListView.qml31
-rw-r--r--components/package/contents/ui/MailViewer.qml18
-rw-r--r--components/package/contents/ui/MessagePartTree.qml18
-rw-r--r--components/package/contents/ui/NewAccountDialog.qml31
-rw-r--r--components/package/contents/ui/Outbox.qml47
-rw-r--r--components/package/contents/ui/OverlayDialog.qml33
-rw-r--r--components/package/contents/ui/SingleMailView.qml33
-rw-r--r--components/package/contents/ui/TextView.qml18
-rw-r--r--components/package/contents/ui/WebView.qml18
-rw-r--r--framework/CMakeLists.txt2
-rw-r--r--framework/actions/actionhandler.cpp12
-rw-r--r--framework/domain/accountfactory.cpp4
-rw-r--r--framework/domain/accountscontroller.cpp10
-rw-r--r--framework/domain/actions/sinkactions.cpp60
-rw-r--r--framework/domain/composercontroller.cpp2
-rw-r--r--framework/domain/folderlistmodel.cpp37
-rw-r--r--framework/domain/identitiesmodel.cpp2
-rw-r--r--framework/domain/maillistmodel.cpp2
-rw-r--r--framework/domain/messageparser.cpp3
-rw-r--r--framework/domain/settings/accountsettings.cpp133
-rw-r--r--framework/settings/CMakeLists.txt3
-rw-r--r--framework/settings/maildir_resource.cpp32
-rw-r--r--framework/settings/maildir_resource.h29
-rw-r--r--framework/settings/resourcelistmodel.cpp42
-rw-r--r--framework/settings/resourcelistmodel.h26
-rw-r--r--framework/settings/resourcescontroller.cpp12
-rw-r--r--framework/settings/resourcescontroller.h20
-rw-r--r--framework/theme/CMakeLists.txt14
-rw-r--r--framework/theme/colorpalette.h47
-rw-r--r--framework/theme/qmldir3
-rw-r--r--framework/theme/themeplugin.cpp50
58 files changed, 880 insertions, 718 deletions
diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml
index 070f08aa..83886572 100644
--- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml
+++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/accounts/imap/tests/settingstest.cpp b/accounts/imap/tests/settingstest.cpp
index 4301943c..2fbc9b7b 100644
--- a/accounts/imap/tests/settingstest.cpp
+++ b/accounts/imap/tests/settingstest.cpp
@@ -43,7 +43,7 @@ private slots:
43 settings.setProperty("emailAddress", emailAddress); 43 settings.setProperty("emailAddress", emailAddress);
44 settings.save(); 44 settings.save();
45 45
46 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { 46 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) {
47 QCOMPARE(resources.size(), 2); 47 QCOMPARE(resources.size(), 2);
48 }) 48 })
49 .exec().waitForFinished(); 49 .exec().waitForFinished();
@@ -76,7 +76,7 @@ private slots:
76 settings.remove(); 76 settings.remove();
77 } 77 }
78 78
79 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { 79 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) {
80 QCOMPARE(resources.size(), 0); 80 QCOMPARE(resources.size(), 0);
81 }) 81 })
82 .exec().waitForFinished(); 82 .exec().waitForFinished();
diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
index 274b9207..753762b7 100644
--- a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
+++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
index 4db7177b..d867c264 100644
--- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
+++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/accounts/maildir/tests/settingstest.cpp b/accounts/maildir/tests/settingstest.cpp
index 342a3b40..47cb3b35 100644
--- a/accounts/maildir/tests/settingstest.cpp
+++ b/accounts/maildir/tests/settingstest.cpp
@@ -39,7 +39,7 @@ private slots:
39 settings.setProperty("emailAddress", emailAddress); 39 settings.setProperty("emailAddress", emailAddress);
40 settings.save(); 40 settings.save();
41 41
42 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { 42 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) {
43 QCOMPARE(resources.size(), 2); 43 QCOMPARE(resources.size(), 2);
44 }) 44 })
45 .exec().waitForFinished(); 45 .exec().waitForFinished();
@@ -70,7 +70,7 @@ private slots:
70 settings.remove(); 70 settings.remove();
71 } 71 }
72 72
73 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { 73 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) {
74 QCOMPARE(resources.size(), 0); 74 QCOMPARE(resources.size(), 0);
75 }) 75 })
76 .exec().waitForFinished(); 76 .exec().waitForFinished();
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml
index 4cda7f8e..ef167bbe 100644
--- a/components/mail/contents/ui/main.qml
+++ b/components/mail/contents/ui/main.qml
@@ -1,19 +1,21 @@
1/* 1/*
2 * Copyright (C) 2015 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2015 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
17 19
18import QtQuick 2.4 20import QtQuick 2.4
19import QtQuick.Controls 1.3 21import QtQuick.Controls 1.3
@@ -280,4 +282,4 @@ ApplicationWindow {
280 } 282 }
281 } 283 }
282 //END ToolBar 284 //END ToolBar
283} \ No newline at end of file 285}
diff --git a/components/mailviewer/qml/EmbededPart.qml b/components/mailviewer/qml/EmbededPart.qml
new file mode 100644
index 00000000..8921ab6f
--- /dev/null
+++ b/components/mailviewer/qml/EmbededPart.qml
@@ -0,0 +1,54 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21Item {
22
23 height: mailPart.height
24 width: mailPart.width
25
26
27 Rectangle {
28 id: border
29 color: "lightgrey"
30 height: mailPart.height
31 width: 5
32 }
33
34 Text {
35 id: sender
36
37 anchors {
38 left: border.right
39 leftMargin: 15
40 }
41
42 text: "sent by " + model.sender + " on " + model.date
43 color: "grey"
44 }
45
46 MailPart {
47 id: mailPart
48
49 anchors.top: sender.bottom
50
51 }
52
53}
54
diff --git a/framework/theme/colorpalette.cpp b/components/mailviewer/qml/EncryptedPart.qml
index a321a292..18a5d588 100644
--- a/framework/theme/colorpalette.cpp
+++ b/components/mailviewer/qml/EncryptedPart.qml
@@ -1,5 +1,5 @@
1/* 1/*
2 Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -16,30 +16,28 @@
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/ 17*/
18 18
19#include "colorpalette.h" 19import QtQuick 2.4
20import QtQuick.Controls 1.5
20 21
21ColorPalette::ColorPalette(QObject *parent) : QObject(parent), m_background("#fcfcfc"), m_selected("#3daee9"), m_read("#232629"), m_border("#232629") 22Item {
22{
23 23
24} 24 height: mailPart.height + 20
25 width: mailPart.width + 20
25 26
26QString ColorPalette::background() const 27 BorderImage {
27{
28 return m_background;
29}
30 28
31QString ColorPalette::read() const 29 anchors.fill: parent
32{ 30 border { left: 40; top: 40; right: 40; bottom: 40 }
33 return m_read; 31 horizontalTileMode: BorderImage.Round
34} 32 verticalTileMode: BorderImage.Round
35 33
36QString ColorPalette::selected() const 34 source: "securityborders" + model.securityLevel + ".png"
37{ 35 }
38 return m_selected;
39}
40 36
41QString ColorPalette::border() const 37 MailPart {
42{ 38 id: mailPart
43 return m_border; 39
44} 40 anchors.centerIn: parent
45 41
42 }
43}
diff --git a/components/mailviewer/qml/HtmlPart.qml b/components/mailviewer/qml/HtmlPart.qml
new file mode 100644
index 00000000..f1add75c
--- /dev/null
+++ b/components/mailviewer/qml/HtmlPart.qml
@@ -0,0 +1,48 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20import QtQuick.Controls 1.3
21import QtWebKit 3.0
22// import QtWebEngine 1.3 //This would give use contentsSize
23import QtWebEngine 1.2
24
25Item {
26 id: root
27 property string content: model.htmlContent
28 property int contentHeight: helperView.contentHeight;
29 //FIXME workaround until QtWebEngine 1.3 with contentsSize
30
31 height: contentHeight
32 width: delegateRoot.width
33
34 WebView {
35 id: helperView
36 visible: false
37 Component.onCompleted: loadHtml(content, "file:///")
38 }
39 WebEngineView {
40 id: htmlView
41 anchors.fill: parent
42 Component.onCompleted: loadHtml(content, "file:///")
43 }
44 onContentChanged: {
45 htmlView.loadHtml(content, "file:///");
46 helperView.loadHtml(content, "file:///");
47 }
48}
diff --git a/components/mailviewer/qml/MailModel.qml b/components/mailviewer/qml/MailModel.qml
new file mode 100644
index 00000000..d18f5ece
--- /dev/null
+++ b/components/mailviewer/qml/MailModel.qml
@@ -0,0 +1,50 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21ListModel {
22
23 ListElement {
24 type: "encrypted"
25 securityLevel: "GREEN"
26 content: [
27 ListElement {
28 type: "plaintext"
29 textContent: "Moin, \n find the forwarded mail below. \n \n - M"
30 embeded: false
31 },
32 ListElement {
33 type: "embeded"
34 sender: "Senderson"
35 date: "05/05/2055"
36 content: [
37 ListElement{
38 type: "plaintext"
39 textContent: "sender mc senderson is a sender. sender mc senderson is a sender. sender mc senderson is a mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc a sender sender mc is a sender sender mc senderson is a sendersender mc senderson is a sender"
40 embeded: true
41 }]
42 }
43 ]
44 }
45 ListElement {
46 type: "plaintext"
47 textContent: "footer mc footerson"
48 embeded: false
49 }
50}
diff --git a/framework/theme/themeplugin.h b/components/mailviewer/qml/MailModel2.qml
index d8ae43c1..9ea45d57 100644
--- a/framework/theme/themeplugin.h
+++ b/components/mailviewer/qml/MailModel2.qml
@@ -1,5 +1,5 @@
1/* 1/*
2 Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -16,16 +16,13 @@
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/ 17*/
18 18
19#pragma once 19import QtQuick 2.4
20 20
21#include <QQmlEngine> 21ListModel {
22#include <QQmlExtensionPlugin>
23 22
24class ThemePlugin : public QQmlExtensionPlugin 23 ListElement {
25{ 24 type: "html"
26 Q_OBJECT 25 htmlContent: "<!DOCTYPE html> <html> <body> <h1>Some Heading</h1> <p>My some paragraph.</p> </body> </html>"
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") 26 }
27}
28 28
29public:
30 virtual void registerTypes(const char *uri);
31}; \ No newline at end of file
diff --git a/components/mailviewer/qml/MailPart.qml b/components/mailviewer/qml/MailPart.qml
new file mode 100644
index 00000000..966337cd
--- /dev/null
+++ b/components/mailviewer/qml/MailPart.qml
@@ -0,0 +1,82 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21Item {
22 id: root
23
24 height: partColumn.height + 40
25 width: delegateRoot.width
26
27 Column {
28 id: partColumn
29
30 anchors {
31 top: parent.top
32 left: parent.left
33 right: parent.right
34 margins: 20
35 }
36
37 spacing: 10
38
39 Repeater {
40 model: content
41
42 delegate: Column {
43 id: delegateRoot
44
45 width: partColumn.width
46
47 Loader {
48 id: loader
49 }
50
51 Component.onCompleted: {
52
53 switch (model.type) {
54 case "encrypted":
55 loader.source = "EncryptedPart.qml";
56 break;
57 case "embeded":
58 loader.source = "EmbededPart.qml";
59 break;
60 case "frame":
61 loader.source = "Frame.qml"
62 break;
63 case "plaintext":
64 loader.source = "TextPart.qml";
65 break;
66 case "html":
67 loader.source = "HtmlPart.qml";
68 break;
69 }
70 }
71 }
72 }
73
74
75 Item {
76 id: footer
77
78 height: 5
79 width: 10
80 }
81 }
82}
diff --git a/framework/theme/unit.h b/components/mailviewer/qml/SignedPart.qml
index bd9b58f0..f0daedeb 100644
--- a/framework/theme/unit.h
+++ b/components/mailviewer/qml/SignedPart.qml
@@ -1,5 +1,5 @@
1/* 1/*
2 Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -16,23 +16,29 @@
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/ 17*/
18 18
19#include <QObject> 19import QtQuick 2.4
20import QtQuick.Controls 1.5
20 21
22Item {
21 23
22class Unit : public QObject 24 height: mailPart.height + 20
23{ 25 width: mailPart.width + 20
24 Q_OBJECT
25 Q_PROPERTY (int size READ size NOTIFY unitChanged)
26 26
27 BorderImage {
27 28
28public: 29 anchors.fill: parent
29 explicit Unit(QObject *parent = Q_NULLPTR); 30 border { left: 40; top: 40; right: 40; bottom: 40 }
31 horizontalTileMode: BorderImage.Round
32 verticalTileMode: BorderImage.Round
30 33
31 int size() const; 34 source: "securityborders" + model.securityLevel + ".png"
35 }
32 36
33signals: 37 MailPart {
34 void unitChanged(); 38 id: mailPart
39
40 anchors.centerIn: parent
41
42 }
43}
35 44
36private:
37 int m_size;
38};
diff --git a/framework/theme/unit.cpp b/components/mailviewer/qml/TextPart.qml
index 1f3803cb..5f183852 100644
--- a/framework/theme/unit.cpp
+++ b/components/mailviewer/qml/TextPart.qml
@@ -1,5 +1,5 @@
1/* 1/*
2 Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -16,14 +16,13 @@
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/ 17*/
18 18
19#include "unit.h" 19import QtQuick 2.4
20 20
21Unit::Unit(QObject *parent) : QObject(parent), m_size(5) 21Text {
22{ 22 width: delegateRoot.width
23 23
24} 24 text: model.textContent
25 wrapMode: Text.WordWrap
25 26
26int Unit::size() const 27 color: embeded ? "grey" : "black"
27{ 28}
28 return m_size;
29} \ No newline at end of file
diff --git a/components/mailviewer/qml/dummyapp.qml b/components/mailviewer/qml/dummyapp.qml
new file mode 100644
index 00000000..a186f0f1
--- /dev/null
+++ b/components/mailviewer/qml/dummyapp.qml
@@ -0,0 +1,90 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21Rectangle {
22 id: app
23
24 width: 1200
25 height: 700
26
27 Rectangle {
28 anchors.fill: parent
29
30 color: "black"
31
32 opacity: 0.8
33
34 }
35
36 Rectangle {
37
38 anchors.centerIn: parent
39
40 height: mainColumn.height + 50
41 width: parent.width * 0.9
42
43 Column {
44 id: mainColumn
45
46 anchors.centerIn: parent
47
48 width: parent.width - 50
49
50 spacing: 10
51
52 Repeater {
53 model: MailModel {}
54
55 delegate: Column {
56 id: delegateRoot
57
58 width: mainColumn.width
59
60 Loader {
61 id: loader
62 }
63
64 Component.onCompleted: {
65 switch (model.type) {
66 case "red":
67 loader.source = "Rect2.qml";
68 break;
69 case "green":
70 loader.source = "Rect1.qml";
71 break;
72 case "encrypted":
73 loader.source = "EncryptedPart.qml";
74 break;
75 case "frame":
76 loader.source = "Frame.qml";
77 break;
78 case "plaintext":
79 loader.source = "TextPart.qml";
80 break;
81 case "html":
82 loader.source = "HtmlPart.qml";
83 break;
84 }
85 }
86 }
87 }
88 }
89 }
90}
diff --git a/components/mailviewer/qml/securitybordersGRAY.png b/components/mailviewer/qml/securitybordersGRAY.png
new file mode 100644
index 00000000..f8b768a8
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersGRAY.png
Binary files differ
diff --git a/components/mailviewer/qml/securitybordersGREEN.png b/components/mailviewer/qml/securitybordersGREEN.png
new file mode 100644
index 00000000..8de8c534
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersGREEN.png
Binary files differ
diff --git a/components/mailviewer/qml/securitybordersRED.png b/components/mailviewer/qml/securitybordersRED.png
new file mode 100644
index 00000000..f28ed990
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersRED.png
Binary files differ
diff --git a/components/mailviewer/qml/securitybordersYELLOW.png b/components/mailviewer/qml/securitybordersYELLOW.png
new file mode 100644
index 00000000..a40a8887
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersYELLOW.png
Binary files differ
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml
index cb79b6e4..8767e96e 100644
--- a/components/package/contents/ui/AccountSwitcher.qml
+++ b/components/package/contents/ui/AccountSwitcher.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
@@ -192,4 +193,4 @@ Button {
192 } 193 }
193 } 194 }
194 } 195 }
195} \ No newline at end of file 196}
diff --git a/components/package/contents/ui/Avatar.qml b/components/package/contents/ui/Avatar.qml
index cfd031b3..dfe14ce7 100644
--- a/components/package/contents/ui/Avatar.qml
+++ b/components/package/contents/ui/Avatar.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2015 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
diff --git a/components/package/contents/ui/Composer.qml b/components/package/contents/ui/Composer.qml
index 1558ba0a..e8dc4e1a 100644
--- a/components/package/contents/ui/Composer.qml
+++ b/components/package/contents/ui/Composer.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/components/package/contents/ui/ContentView.qml b/components/package/contents/ui/ContentView.qml
index a8f4c437..099d5c5d 100644
--- a/components/package/contents/ui/ContentView.qml
+++ b/components/package/contents/ui/ContentView.qml
@@ -1,3 +1,21 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
1import QtQuick 2.4 19import QtQuick 2.4
2import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
3 21
diff --git a/components/package/contents/ui/EditAccountDialog.qml b/components/package/contents/ui/EditAccountDialog.qml
index 887f50e1..6045faf8 100644
--- a/components/package/contents/ui/EditAccountDialog.qml
+++ b/components/package/contents/ui/EditAccountDialog.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml
index 4d5499d9..bbee1edc 100644
--- a/components/package/contents/ui/FocusComposer.qml
+++ b/components/package/contents/ui/FocusComposer.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml
index c8284b0a..bf4263c4 100644
--- a/components/package/contents/ui/FolderListView.qml
+++ b/components/package/contents/ui/FolderListView.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2015 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/components/package/contents/ui/ListItem.qml b/components/package/contents/ui/ListItem.qml
index bea3c11b..0f3b7af9 100644
--- a/components/package/contents/ui/ListItem.qml
+++ b/components/package/contents/ui/ListItem.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2015 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import org.kube.framework.theme 1.0 20import org.kube.framework.theme 1.0
diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml
index d0278833..ff71e43e 100644
--- a/components/package/contents/ui/MailListView.qml
+++ b/components/package/contents/ui/MailListView.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2015 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 as Controls 20import QtQuick.Controls 1.4 as Controls
diff --git a/components/package/contents/ui/MailViewer.qml b/components/package/contents/ui/MailViewer.qml
index 9abd30be..5365be66 100644
--- a/components/package/contents/ui/MailViewer.qml
+++ b/components/package/contents/ui/MailViewer.qml
@@ -1,3 +1,21 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
1import QtQuick 2.4 19import QtQuick 2.4
2import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
3import QtQuick.Controls 1.4 21import QtQuick.Controls 1.4
diff --git a/components/package/contents/ui/MessagePartTree.qml b/components/package/contents/ui/MessagePartTree.qml
index 8bc13e6e..a904f42c 100644
--- a/components/package/contents/ui/MessagePartTree.qml
+++ b/components/package/contents/ui/MessagePartTree.qml
@@ -1,3 +1,21 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
1import QtQuick 2.4 19import QtQuick 2.4
2import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
3 21
diff --git a/components/package/contents/ui/NewAccountDialog.qml b/components/package/contents/ui/NewAccountDialog.qml
index 9183be65..e565cb6a 100644
--- a/components/package/contents/ui/NewAccountDialog.qml
+++ b/components/package/contents/ui/NewAccountDialog.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
diff --git a/components/package/contents/ui/Outbox.qml b/components/package/contents/ui/Outbox.qml
index 4baa0eae..01501410 100644
--- a/components/package/contents/ui/Outbox.qml
+++ b/components/package/contents/ui/Outbox.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
@@ -38,13 +39,15 @@ ToolButton {
38 Rectangle { 39 Rectangle {
39 id: dialog 40 id: dialog
40 41
42 property int modelCount: 5 //FIXME replace with actual model
43
41 anchors { 44 anchors {
42 top: parent.bottom 45 top: parent.bottom
43 horizontalCenter: parent.horizontalCenter 46 horizontalCenter: parent.horizontalCenter
44 } 47 }
45 48
46 height: Kirigami.Units.gridUnit * 15 49 height: modelCount * Kirigami.Units.gridUnit * 3 + 10//scrollView.height height: Kirigami.Units.gridUnit * 15
47 width: Kirigami.Units.gridUnit * 12 50 width: Kirigami.Units.gridUnit * 12
48 51
49 color: Kirigami.Theme.backgroundColor 52 color: Kirigami.Theme.backgroundColor
50 border.width: 1 53 border.width: 1
@@ -55,16 +58,22 @@ ToolButton {
55 58
56 //BEGIN Dialog Content 59 //BEGIN Dialog Content
57 ScrollView { 60 ScrollView {
61 id: scrollView
62
58 anchors { 63 anchors {
59 fill: parent 64 fill: parent
60 margins: 1 65 margins: 5
61 } 66 }
67
62 ListView { 68 ListView {
63 id: listView 69 id: listView
64 70
65 model: 3 71 model: 5
66 72
67 delegate: Kirigami.AbstractListItem { 73 delegate: Kirigami.AbstractListItem {
74
75 height: Kirigami.Units.gridUnit * 3
76
68 Kirigami.Label { 77 Kirigami.Label {
69 anchors.centerIn: parent 78 anchors.centerIn: parent
70 text: "Subjext subxetson" 79 text: "Subjext subxetson"
diff --git a/components/package/contents/ui/OverlayDialog.qml b/components/package/contents/ui/OverlayDialog.qml
index 226ed79d..da75ca99 100644
--- a/components/package/contents/ui/OverlayDialog.qml
+++ b/components/package/contents/ui/OverlayDialog.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.4 20import QtQuick.Controls 1.4
@@ -59,4 +60,4 @@ Item {
59 anchors.fill: parent 60 anchors.fill: parent
60 } 61 }
61 } 62 }
62} \ No newline at end of file 63}
diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml
index ea8a7730..b06216dd 100644
--- a/components/package/contents/ui/SingleMailView.qml
+++ b/components/package/contents/ui/SingleMailView.qml
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (C) 2015 Michael Bohlender <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * 3
4 * This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version. 7 (at your option) any later version.
8 * 8
9 * This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 GNU General Public License for more details.
13 * 13
14 * You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 with this program; if not, write to the Free Software Foundation, Inc.,
16 */ 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
17 18
18import QtQuick 2.4 19import QtQuick 2.4
19import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
@@ -229,4 +230,4 @@ Item {
229 } 230 }
230 } 231 }
231 } 232 }
232} \ No newline at end of file 233}
diff --git a/components/package/contents/ui/TextView.qml b/components/package/contents/ui/TextView.qml
index 7c2f3153..d0ff9999 100644
--- a/components/package/contents/ui/TextView.qml
+++ b/components/package/contents/ui/TextView.qml
@@ -1,3 +1,21 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
1import QtQuick 2.4 19import QtQuick 2.4
2import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
3 21
diff --git a/components/package/contents/ui/WebView.qml b/components/package/contents/ui/WebView.qml
index 01998911..4c7aab53 100644
--- a/components/package/contents/ui/WebView.qml
+++ b/components/package/contents/ui/WebView.qml
@@ -1,3 +1,21 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
1import QtQuick 2.4 19import QtQuick 2.4
2import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
3import QtWebKit 3.0 21import QtWebKit 3.0
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt
index 4fecaf14..95be342d 100644
--- a/framework/CMakeLists.txt
+++ b/framework/CMakeLists.txt
@@ -41,7 +41,5 @@ add_subdirectory(actions)
41add_subdirectory(settings) 41add_subdirectory(settings)
42# Domain specific domain logic 42# Domain specific domain logic
43add_subdirectory(domain) 43add_subdirectory(domain)
44# Theme specfic things like colors
45add_subdirectory(theme)
46 44
47feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 45feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/framework/actions/actionhandler.cpp b/framework/actions/actionhandler.cpp
index 4ae8d0a9..9d58f464 100644
--- a/framework/actions/actionhandler.cpp
+++ b/framework/actions/actionhandler.cpp
@@ -106,14 +106,12 @@ ActionResult ActionHandlerHelper::execute(Context *context)
106 handlerFunction(context); 106 handlerFunction(context);
107 result.setDone(); 107 result.setDone();
108 } else { 108 } else {
109 jobHandlerFunction(context).then<void>([=]() { 109 jobHandlerFunction(context).syncThen<void>([=](const KAsync::Error &error) {
110 auto modifyableResult = result; 110 auto modifyableResult = result;
111 modifyableResult.setDone(); 111 if (error) {
112 }, 112 qWarning() << "Job failed: " << error.errorCode << error.errorMessage;
113 [=](int errorCode, const QString &string) { 113 modifyableResult.setError(1);
114 qWarning() << "Job failed: " << errorCode << string; 114 }
115 auto modifyableResult = result;
116 modifyableResult.setError(1);
117 modifyableResult.setDone(); 115 modifyableResult.setDone();
118 }).exec(); 116 }).exec();
119 } 117 }
diff --git a/framework/domain/accountfactory.cpp b/framework/domain/accountfactory.cpp
index 10f01f65..182a0a1d 100644
--- a/framework/domain/accountfactory.cpp
+++ b/framework/domain/accountfactory.cpp
@@ -43,8 +43,8 @@ QString AccountFactory::name() const
43void AccountFactory::setAccountId(const QString &accountId) 43void AccountFactory::setAccountId(const QString &accountId)
44{ 44{
45 mAccountId = accountId; 45 mAccountId = accountId;
46 Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query::IdentityFilter(accountId.toUtf8())) 46 Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query().filter(accountId.toUtf8()))
47 .then<void, Sink::ApplicationDomain::SinkAccount>([this](const Sink::ApplicationDomain::SinkAccount &account) { 47 .syncThen<void, Sink::ApplicationDomain::SinkAccount>([this](const Sink::ApplicationDomain::SinkAccount &account) {
48 mAccountType = account.getProperty("type").toByteArray(); 48 mAccountType = account.getProperty("type").toByteArray();
49 loadPackage(); 49 loadPackage();
50 }).exec(); 50 }).exec();
diff --git a/framework/domain/accountscontroller.cpp b/framework/domain/accountscontroller.cpp
index 2f47fa03..5cb60d0c 100644
--- a/framework/domain/accountscontroller.cpp
+++ b/framework/domain/accountscontroller.cpp
@@ -34,9 +34,9 @@ void AccountsController::createAccount(const QString &accountType)
34{ 34{
35 auto account = Sink::ApplicationDomain::ApplicationDomainType::createEntity<Sink::ApplicationDomain::SinkAccount>(); 35 auto account = Sink::ApplicationDomain::ApplicationDomainType::createEntity<Sink::ApplicationDomain::SinkAccount>();
36 account.setProperty("type", accountType); 36 account.setProperty("type", accountType);
37 Sink::Store::create(account).then<void>([]() {}, 37 Sink::Store::create(account).syncThen<void>([](const KAsync::Error &error) {
38 [](int errorCode, const QString &errorMessage) { 38 if (error) {
39 qWarning() << "Error while creating account: " << errorMessage; 39 qWarning() << "Error while creating account: " << error.errorMessage;
40 }) 40 }
41 .exec(); 41 }).exec();
42} 42}
diff --git a/framework/domain/actions/sinkactions.cpp b/framework/domain/actions/sinkactions.cpp
index 921fe748..cc8d324e 100644
--- a/framework/domain/actions/sinkactions.cpp
+++ b/framework/domain/actions/sinkactions.cpp
@@ -28,20 +28,22 @@
28SINK_DEBUG_AREA("sinkactions") 28SINK_DEBUG_AREA("sinkactions")
29 29
30using namespace Kube; 30using namespace Kube;
31using namespace Sink;
32using namespace Sink::ApplicationDomain;
31 33
32static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read", 34static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read",
33 [](Context *context) -> bool { 35 [](Context *context) -> bool {
34 return context->property("mail").isValid(); 36 return context->property("mail").isValid();
35 }, 37 },
36 [](Context *context) { 38 [](Context *context) {
37 auto mail = context->property("mail").value<Sink::ApplicationDomain::Mail::Ptr>(); 39 auto mail = context->property("mail").value<Mail::Ptr>();
38 if (!mail) { 40 if (!mail) {
39 SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); 41 SinkWarning() << "Failed to get the mail mail: " << context->property("mail");
40 return; 42 return;
41 } 43 }
42 mail->setProperty("unread", false); 44 mail->setProperty("unread", false);
43 SinkLog() << "Mark as read " << mail->identifier(); 45 SinkLog() << "Mark as read " << mail->identifier();
44 Sink::Store::modify(*mail).exec(); 46 Store::modify(*mail).exec();
45 } 47 }
46); 48);
47 49
@@ -50,14 +52,14 @@ static ActionHandlerHelper moveToTrashHandler("org.kde.kube.actions.move-to-tras
50 return context->property("mail").isValid(); 52 return context->property("mail").isValid();
51 }, 53 },
52 [](Context *context) { 54 [](Context *context) {
53 auto mail = context->property("mail").value<Sink::ApplicationDomain::Mail::Ptr>(); 55 auto mail = context->property("mail").value<Mail::Ptr>();
54 if (!mail) { 56 if (!mail) {
55 SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); 57 SinkWarning() << "Failed to get the mail mail: " << context->property("mail");
56 return; 58 return;
57 } 59 }
58 mail->setTrash(true); 60 mail->setTrash(true);
59 SinkLog() << "Move to trash " << mail->identifier(); 61 SinkLog() << "Move to trash " << mail->identifier();
60 Sink::Store::modify(*mail).exec(); 62 Store::modify(*mail).exec();
61 } 63 }
62); 64);
63 65
@@ -66,13 +68,13 @@ static ActionHandlerHelper deleteHandler("org.kde.kube.actions.delete",
66 return context->property("mail").isValid(); 68 return context->property("mail").isValid();
67 }, 69 },
68 [](Context *context) { 70 [](Context *context) {
69 auto mail = context->property("mail").value<Sink::ApplicationDomain::Mail::Ptr>(); 71 auto mail = context->property("mail").value<Mail::Ptr>();
70 if (!mail) { 72 if (!mail) {
71 SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); 73 SinkWarning() << "Failed to get the mail mail: " << context->property("mail");
72 return; 74 return;
73 } 75 }
74 SinkLog() << "Remove " << mail->identifier(); 76 SinkLog() << "Remove " << mail->identifier();
75 Sink::Store::remove(*mail).exec(); 77 Store::remove(*mail).exec();
76 } 78 }
77); 79);
78 80
@@ -81,12 +83,12 @@ static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize"
81 return true; 83 return true;
82 }, 84 },
83 [](Context *context) { 85 [](Context *context) {
84 if (auto folder = context->property("folder").value<Sink::ApplicationDomain::Folder::Ptr>()) { 86 if (auto folder = context->property("folder").value<Folder::Ptr>()) {
85 SinkLog() << "Synchronizing resource " << folder->resourceInstanceIdentifier(); 87 SinkLog() << "Synchronizing resource " << folder->resourceInstanceIdentifier();
86 Sink::Store::synchronize(Sink::Query::ResourceFilter(folder->resourceInstanceIdentifier())).exec(); 88 Store::synchronize(Query().resourceFilter(folder->resourceInstanceIdentifier())).exec();
87 } else { 89 } else {
88 SinkLog() << "Synchronizing all"; 90 SinkLog() << "Synchronizing all";
89 Sink::Store::synchronize(Sink::Query()).exec(); 91 Store::synchronize(Query()).exec();
90 } 92 }
91 } 93 }
92); 94);
@@ -102,17 +104,17 @@ static ActionHandlerHelper sendMailHandler("org.kde.kube.actions.sendmail",
102 auto message = context->property("message").value<KMime::Message::Ptr>(); 104 auto message = context->property("message").value<KMime::Message::Ptr>();
103 SinkLog() << "Sending a mail: "; 105 SinkLog() << "Sending a mail: ";
104 106
105 Sink::Query query; 107 Query query;
106 query += Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport); 108 query.containsFilter<ApplicationDomain::SinkResource::Capabilities>(ApplicationDomain::ResourceCapabilities::Mail::transport);
107 query += Sink::Query::AccountFilter(accountId); 109 query.filter<SinkResource::Account>(accountId);
108 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(query) 110 Store::fetchAll<ApplicationDomain::SinkResource>(query)
109 .then<void, KAsync::Job<void>, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([=](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) -> KAsync::Job<void> { 111 .then<void, QList<ApplicationDomain::SinkResource::Ptr>>([=](const QList<ApplicationDomain::SinkResource::Ptr> &resources) -> KAsync::Job<void> {
110 if (!resources.isEmpty()) { 112 if (!resources.isEmpty()) {
111 auto resourceId = resources[0]->identifier(); 113 auto resourceId = resources[0]->identifier();
112 SinkTrace() << "Sending message via resource: " << resourceId; 114 SinkTrace() << "Sending message via resource: " << resourceId;
113 Sink::ApplicationDomain::Mail mail(resourceId); 115 Mail mail(resourceId);
114 mail.setBlobProperty("mimeMessage", message->encodedContent()); 116 mail.setBlobProperty("mimeMessage", message->encodedContent());
115 return Sink::Store::create(mail); 117 return Store::create(mail);
116 } 118 }
117 SinkWarning() << "Failed to find a mailtransport resource"; 119 SinkWarning() << "Failed to find a mailtransport resource";
118 return KAsync::error<void>(0, "Failed to find a MailTransport resource."); 120 return KAsync::error<void>(0, "Failed to find a MailTransport resource.");
@@ -127,30 +129,30 @@ static ActionHandlerHelper saveAsDraft("org.kde.kube.actions.save-as-draft",
127 return !accountId.isEmpty() && message; 129 return !accountId.isEmpty() && message;
128 }, 130 },
129 ActionHandlerHelper::JobHandler([](Context *context) -> KAsync::Job<void> { 131 ActionHandlerHelper::JobHandler([](Context *context) -> KAsync::Job<void> {
130 SinkWarning() << "executing save as draft"; 132 SinkLog() << "Executing the save-as-draft action";
131 const auto accountId = context->property("accountId").value<QByteArray>(); 133 const auto accountId = context->property("accountId").value<QByteArray>();
132 const auto message = context->property("message").value<KMime::Message::Ptr>(); 134 const auto message = context->property("message").value<KMime::Message::Ptr>();
133 auto existingMail = context->property("existingMail").value<Sink::ApplicationDomain::Mail>(); 135 auto existingMail = context->property("existingMail").value<Mail>();
134 if (!message) { 136 if (!message) {
135 SinkWarning() << "Failed to get the mail: " << context->property("mail"); 137 SinkWarning() << "Failed to get the mail: " << context->property("mail");
136 return KAsync::error<void>(1, "Failed to get the mail: " + context->property("mail").toString()); 138 return KAsync::error<void>(1, "Failed to get the mail: " + context->property("mail").toString());
137 } 139 }
138 140
139 if (existingMail.identifier().isEmpty()) { 141 if (existingMail.identifier().isEmpty()) {
140 Sink::Query query; 142 Query query;
141 query += Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::drafts); 143 query.containsFilter<SinkResource::Capabilities>(ApplicationDomain::ResourceCapabilities::Mail::drafts);
142 query += Sink::Query::AccountFilter(accountId); 144 query.filter<SinkResource::Account>(accountId);
143 return Sink::Store::fetchOne<Sink::ApplicationDomain::SinkResource>(query) 145 return Store::fetchOne<SinkResource>(query)
144 .then<void, KAsync::Job<void>, Sink::ApplicationDomain::SinkResource>([=](const Sink::ApplicationDomain::SinkResource &resource) -> KAsync::Job<void> { 146 .then<void, SinkResource>([=](const SinkResource &resource) -> KAsync::Job<void> {
145 Sink::ApplicationDomain::Mail mail(resource.identifier()); 147 Mail mail(resource.identifier());
146 mail.setProperty("draft", true); 148 mail.setDraft(true);
147 mail.setBlobProperty("mimeMessage", message->encodedContent()); 149 mail.setMimeMessage(message->encodedContent());
148 return Sink::Store::create(mail); 150 return Store::create(mail);
149 }); 151 });
150 } else { 152 } else {
151 SinkWarning() << "Modifying an existing mail" << existingMail.identifier(); 153 SinkWarning() << "Modifying an existing mail" << existingMail.identifier();
152 existingMail.setBlobProperty("mimeMessage", message->encodedContent()); 154 existingMail.setMimeMessage(message->encodedContent());
153 return Sink::Store::modify(existingMail); 155 return Store::modify(existingMail);
154 } 156 }
155 }) 157 })
156); 158);
diff --git a/framework/domain/composercontroller.cpp b/framework/domain/composercontroller.cpp
index 2dcf1bb1..b2ad7ecc 100644
--- a/framework/domain/composercontroller.cpp
+++ b/framework/domain/composercontroller.cpp
@@ -133,7 +133,7 @@ void ComposerController::loadMessage(const QVariant &message, bool loadAsDraft)
133{ 133{
134 Sink::Query query(*message.value<Sink::ApplicationDomain::Mail::Ptr>()); 134 Sink::Query query(*message.value<Sink::ApplicationDomain::Mail::Ptr>());
135 query.request<Sink::ApplicationDomain::Mail::MimeMessage>(); 135 query.request<Sink::ApplicationDomain::Mail::MimeMessage>();
136 Sink::Store::fetchOne<Sink::ApplicationDomain::Mail>(query).then<void, Sink::ApplicationDomain::Mail>([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) { 136 Sink::Store::fetchOne<Sink::ApplicationDomain::Mail>(query).syncThen<void, Sink::ApplicationDomain::Mail>([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) {
137 m_existingMail = mail; 137 m_existingMail = mail;
138 const auto mailData = KMime::CRLFtoLF(mail.getMimeMessage()); 138 const auto mailData = KMime::CRLFtoLF(mail.getMimeMessage());
139 if (!mailData.isEmpty()) { 139 if (!mailData.isEmpty()) {
diff --git a/framework/domain/folderlistmodel.cpp b/framework/domain/folderlistmodel.cpp
index 14d3d5a7..7cf5ad5d 100644
--- a/framework/domain/folderlistmodel.cpp
+++ b/framework/domain/folderlistmodel.cpp
@@ -22,11 +22,14 @@
22#include <sink/store.h> 22#include <sink/store.h>
23#include <settings/settings.h> 23#include <settings/settings.h>
24 24
25using namespace Sink;
26using namespace Sink::ApplicationDomain;
27
25FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() 28FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel()
26{ 29{
27 Sink::Query query; 30 Query query;
28 query.liveQuery = true; 31 query.liveQuery = true;
29 query.requestedProperties << "name" << "icon" << "parent"; 32 query.request<Folder::Name>().request<Folder::Icon>().request<Folder::Parent>();
30 query.parentProperty = "parent"; 33 query.parentProperty = "parent";
31 runQuery(query); 34 runQuery(query);
32} 35}
@@ -57,34 +60,32 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const
57 case Icon: 60 case Icon:
58 return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); 61 return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString();
59 case Id: 62 case Id:
60 return srcIdx.data(Sink::Store::DomainObjectBaseRole).value<Sink::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier(); 63 return srcIdx.data(Store::DomainObjectBaseRole).value<ApplicationDomainType::Ptr>()->identifier();
61 case DomainObject: 64 case DomainObject:
62 return srcIdx.data(Sink::Store::DomainObjectRole); 65 return srcIdx.data(Store::DomainObjectRole);
63 } 66 }
64 return QIdentityProxyModel::data(idx, role); 67 return QIdentityProxyModel::data(idx, role);
65} 68}
66 69
67void FolderListModel::runQuery(const Sink::Query &query) 70void FolderListModel::runQuery(const Query &query)
68{ 71{
69 mModel = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); 72 mModel = Store::loadModel<Folder>(query);
70 setSourceModel(mModel.data()); 73 setSourceModel(mModel.data());
71} 74}
72 75
73void FolderListModel::setAccountId(const QVariant &accountId) 76void FolderListModel::setAccountId(const QVariant &accountId)
74{ 77{
75 const auto account = accountId.toString().toUtf8(); 78 const auto account = accountId.toString().toUtf8();
76 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query::PropertyFilter("account", QVariant::fromValue(account))) 79
77 .then<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([this, account](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { 80 //Get all folders of an account
78 Sink::Query query; 81 auto query = Query();
79 query.liveQuery = true; 82 query.resourceFilter<SinkResource::Account>(account);
80 query.requestedProperties << "name" << "icon" << "parent"; 83 query.liveQuery = true;
81 query.parentProperty = "parent"; 84 query.request<Folder::Name>()
82 for (const auto &r : resources) { 85 .request<Folder::Icon>()
83 qDebug() << "Found resources for account: " << r->identifier() << account; 86 .request<Folder::Parent>();
84 query.resources << r->identifier(); 87 query.parentProperty = Folder::Parent::name;
85 } 88 runQuery(query);
86 runQuery(query);
87 }).exec();
88} 89}
89 90
90QVariant FolderListModel::accountId() const 91QVariant FolderListModel::accountId() const
diff --git a/framework/domain/identitiesmodel.cpp b/framework/domain/identitiesmodel.cpp
index adb5d625..1958d2f5 100644
--- a/framework/domain/identitiesmodel.cpp
+++ b/framework/domain/identitiesmodel.cpp
@@ -83,7 +83,7 @@ void IdentitiesModel::runQuery(const Sink::Query &query)
83 setSourceModel(mModel.data()); 83 setSourceModel(mModel.data());
84 84
85 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkAccount>(Sink::Query()) 85 Sink::Store::fetchAll<Sink::ApplicationDomain::SinkAccount>(Sink::Query())
86 .then<void, QList<Sink::ApplicationDomain::SinkAccount::Ptr> >([this](const QList<Sink::ApplicationDomain::SinkAccount::Ptr> &accounts) { 86 .syncThen<void, QList<Sink::ApplicationDomain::SinkAccount::Ptr> >([this](const QList<Sink::ApplicationDomain::SinkAccount::Ptr> &accounts) {
87 for (const auto &account : accounts) { 87 for (const auto &account : accounts) {
88 mAccountNames.insert(account->identifier(), account->getProperty("name").toString()); 88 mAccountNames.insert(account->identifier(), account->getProperty("name").toString());
89 mAccountIcons.insert(account->identifier(), account->getProperty("icon").toString()); 89 mAccountIcons.insert(account->identifier(), account->getProperty("icon").toString());
diff --git a/framework/domain/maillistmodel.cpp b/framework/domain/maillistmodel.cpp
index e3f555c4..9afb6408 100644
--- a/framework/domain/maillistmodel.cpp
+++ b/framework/domain/maillistmodel.cpp
@@ -107,7 +107,7 @@ void MailListModel::setParentFolder(const QVariant &parentFolder)
107 } 107 }
108 Sink::Query query; 108 Sink::Query query;
109 query.liveQuery = true; 109 query.liveQuery = true;
110 query.resources << folder->resourceInstanceIdentifier(); 110 query.resourceFilter(folder->resourceInstanceIdentifier());
111 query.sort<Mail::Date>(); 111 query.sort<Mail::Date>();
112 query.limit = 100; 112 query.limit = 100;
113 query.request<Mail::Subject>(); 113 query.request<Mail::Subject>();
diff --git a/framework/domain/messageparser.cpp b/framework/domain/messageparser.cpp
index 262be0b7..febd1363 100644
--- a/framework/domain/messageparser.cpp
+++ b/framework/domain/messageparser.cpp
@@ -101,7 +101,8 @@ QVariant PartModel::data(const QModelIndex &index, int role) const
101 case Type: 101 case Type:
102 return part->metaObject()->className(); 102 return part->metaObject()->className();
103 case IsHidden: 103 case IsHidden:
104 return part->property("isHidden").toBool(); 104 return false;
105 //return part->property("isHidden").toBool();
105 106
106 } 107 }
107 } 108 }
diff --git a/framework/domain/settings/accountsettings.cpp b/framework/domain/settings/accountsettings.cpp
index cf348f39..ea798a73 100644
--- a/framework/domain/settings/accountsettings.cpp
+++ b/framework/domain/settings/accountsettings.cpp
@@ -23,6 +23,9 @@
23#include <QDir> 23#include <QDir>
24#include <QUrl> 24#include <QUrl>
25 25
26using namespace Sink;
27using namespace Sink::ApplicationDomain;
28
26AccountSettings::AccountSettings(QObject *parent) 29AccountSettings::AccountSettings(QObject *parent)
27 : QObject(parent) 30 : QObject(parent)
28{ 31{
@@ -130,87 +133,83 @@ void AccountSettings::saveAccount()
130{ 133{
131 qDebug() << "Saving account " << mAccountIdentifier << mMailtransportIdentifier; 134 qDebug() << "Saving account " << mAccountIdentifier << mMailtransportIdentifier;
132 Q_ASSERT(!mAccountIdentifier.isEmpty()); 135 Q_ASSERT(!mAccountIdentifier.isEmpty());
133 Sink::ApplicationDomain::SinkAccount account(mAccountIdentifier); 136 SinkAccount account(mAccountIdentifier);
134 account.setProperty("type", "imap"); 137 account.setAccountType("imap");
135 account.setProperty("name", mName); 138 account.setName(mName);
136 account.setProperty("icon", mIcon); 139 account.setIcon(mIcon);
137 Q_ASSERT(!account.identifier().isEmpty()); 140 Q_ASSERT(!account.identifier().isEmpty());
138 Sink::Store::modify(account).then<void>([]() {}, 141 Store::modify(account)
139 [](int errorCode, const QString &errorMessage) { 142 .onError([](const KAsync::Error &error) {
140 qWarning() << "Error while creating account: " << errorMessage; 143 qWarning() << "Error while creating account: " << error.errorMessage;;
141 }) 144 })
142 .exec(); 145 .exec();
143} 146}
144 147
145void AccountSettings::loadAccount() 148void AccountSettings::loadAccount()
146{ 149{
147 Q_ASSERT(!mAccountIdentifier.isEmpty()); 150 Q_ASSERT(!mAccountIdentifier.isEmpty());
148 Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query::IdentityFilter(mAccountIdentifier)) 151 Store::fetchOne<SinkAccount>(Query().filter(mAccountIdentifier))
149 .then<void, Sink::ApplicationDomain::SinkAccount>([this](const Sink::ApplicationDomain::SinkAccount &account) { 152 .syncThen<void, SinkAccount>([this](const SinkAccount &account) {
150 mIcon = account.getProperty("icon").toString(); 153 mIcon = account.getIcon();
151 mName = account.getProperty("name").toString(); 154 mName = account.getName();
152 emit changed(); 155 emit changed();
153 }).exec(); 156 }).exec();
154} 157}
155 158
156void AccountSettings::loadImapResource() 159void AccountSettings::loadImapResource()
157{ 160{
158 Sink::Store::fetchOne<Sink::ApplicationDomain::SinkResource>(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) 161 Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage))
159 .then<void, Sink::ApplicationDomain::SinkResource>([this](const Sink::ApplicationDomain::SinkResource &resource) { 162 .syncThen<void, SinkResource>([this](const SinkResource &resource) {
160 mImapIdentifier = resource.identifier(); 163 mImapIdentifier = resource.identifier();
161 mImapServer = resource.getProperty("server").toString(); 164 mImapServer = resource.getProperty("server").toString();
162 mImapUsername = resource.getProperty("username").toString(); 165 mImapUsername = resource.getProperty("username").toString();
163 mImapPassword = resource.getProperty("password").toString(); 166 mImapPassword = resource.getProperty("password").toString();
164 emit imapResourceChanged(); 167 emit imapResourceChanged();
165 }, 168 }).onError([](const KAsync::Error &error) {
166 [](int errorCode, const QString &errorMessage) { 169 qWarning() << "Failed to find the imap resource: " << error.errorMessage;
167 qWarning() << "Failed to find the imap resource: " << errorMessage;
168 }).exec(); 170 }).exec();
169} 171}
170 172
171void AccountSettings::loadMaildirResource() 173void AccountSettings::loadMaildirResource()
172{ 174{
173 Sink::Store::fetchOne<Sink::ApplicationDomain::SinkResource>(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) 175 Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage))
174 .then<void, Sink::ApplicationDomain::SinkResource>([this](const Sink::ApplicationDomain::SinkResource &resource) { 176 .syncThen<void, SinkResource>([this](const SinkResource &resource) {
175 mMaildirIdentifier = resource.identifier(); 177 mMaildirIdentifier = resource.identifier();
176 auto path = resource.getProperty("path").toString(); 178 auto path = resource.getProperty("path").toString();
177 if (mPath != path) { 179 if (mPath != path) {
178 mPath = path; 180 mPath = path;
179 emit pathChanged(); 181 emit pathChanged();
180 } 182 }
181 }, 183 }).onError([](const KAsync::Error &error) {
182 [](int errorCode, const QString &errorMessage) { 184 qWarning() << "Failed to find the maildir resource: " << error.errorMessage;
183 qWarning() << "Failed to find the maildir resource: " << errorMessage;
184 }).exec(); 185 }).exec();
185} 186}
186 187
187void AccountSettings::loadMailtransportResource() 188void AccountSettings::loadMailtransportResource()
188{ 189{
189 Sink::Store::fetchOne<Sink::ApplicationDomain::SinkResource>(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport)) 190 Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::transport))
190 .then<void, Sink::ApplicationDomain::SinkResource>([this](const Sink::ApplicationDomain::SinkResource &resource) { 191 .syncThen<void, SinkResource>([this](const SinkResource &resource) {
191 mMailtransportIdentifier = resource.identifier(); 192 mMailtransportIdentifier = resource.identifier();
192 mSmtpServer = resource.getProperty("server").toString(); 193 mSmtpServer = resource.getProperty("server").toString();
193 mSmtpUsername = resource.getProperty("username").toString(); 194 mSmtpUsername = resource.getProperty("username").toString();
194 mSmtpPassword = resource.getProperty("password").toString(); 195 mSmtpPassword = resource.getProperty("password").toString();
195 emit smtpResourceChanged(); 196 emit smtpResourceChanged();
196 }, 197 }).onError([](const KAsync::Error &error) {
197 [](int errorCode, const QString &errorMessage) { 198 qWarning() << "Failed to find the smtp resource: " << error.errorMessage;
198 qWarning() << "Failed to find the smtp resource: " << errorMessage;
199 }).exec(); 199 }).exec();
200} 200}
201 201
202void AccountSettings::loadIdentity() 202void AccountSettings::loadIdentity()
203{ 203{
204 //FIXME this assumes that we only ever have one identity per account 204 //FIXME this assumes that we only ever have one identity per account
205 Sink::Store::fetchOne<Sink::ApplicationDomain::Identity>(Sink::Query::AccountFilter(mAccountIdentifier)) 205 Store::fetchOne<Identity>(Query().filter<Identity::Account>(mAccountIdentifier))
206 .then<void, Sink::ApplicationDomain::Identity>([this](const Sink::ApplicationDomain::Identity &identity) { 206 .syncThen<void, Identity>([this](const Identity &identity) {
207 mIdentityIdentifier = identity.identifier(); 207 mIdentityIdentifier = identity.identifier();
208 mUsername = identity.getProperty("username").toString(); 208 mUsername = identity.getProperty("username").toString();
209 mEmailAddress = identity.getProperty("address").toString(); 209 mEmailAddress = identity.getProperty("address").toString();
210 emit identityChanged(); 210 emit identityChanged();
211 }, 211 }).onError([](const KAsync::Error &error) {
212 [](int errorCode, const QString &errorMessage) { 212 qWarning() << "Failed to find the identity resource: " << error.errorMessage;
213 qWarning() << "Failed to find the identity resource: " << errorMessage;
214 }).exec(); 213 }).exec();
215} 214}
216 215
@@ -220,25 +219,26 @@ template<typename ResourceType>
220static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteArray &identifier, const std::map<QByteArray, QVariant> &properties) 219static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteArray &identifier, const std::map<QByteArray, QVariant> &properties)
221{ 220{
222 if (!identifier.isEmpty()) { 221 if (!identifier.isEmpty()) {
223 Sink::ApplicationDomain::SinkResource resource(identifier); 222 SinkResource resource(identifier);
224 for (const auto &pair : properties) { 223 for (const auto &pair : properties) {
225 resource.setProperty(pair.first, pair.second); 224 resource.setProperty(pair.first, pair.second);
226 } 225 }
227 Sink::Store::modify(resource).then<void>([](){}, [](int errorCode, const QString &errorMessage) { 226 Store::modify(resource)
228 qWarning() << "Error while modifying resource: " << errorMessage; 227 .onError([](const KAsync::Error &error) {
229 }) 228 qWarning() << "Error while modifying resource: " << error.errorMessage;
230 .exec(); 229 })
230 .exec();
231 } else { 231 } else {
232 auto resource = ResourceType::create(accountIdentifier); 232 auto resource = ResourceType::create(accountIdentifier);
233 auto newIdentifier = resource.identifier(); 233 auto newIdentifier = resource.identifier();
234 for (const auto &pair : properties) { 234 for (const auto &pair : properties) {
235 resource.setProperty(pair.first, pair.second); 235 resource.setProperty(pair.first, pair.second);
236 } 236 }
237 Sink::Store::create(resource).template then<void>([]() {}, 237 Store::create(resource)
238 [](int errorCode, const QString &errorMessage) { 238 .onError([](const KAsync::Error &error) {
239 qWarning() << "Error while creating resource: " << errorMessage; 239 qWarning() << "Error while creating resource: " << error.errorMessage;
240 }) 240 })
241 .exec(); 241 .exec();
242 return newIdentifier; 242 return newIdentifier;
243 } 243 }
244 return identifier; 244 return identifier;
@@ -246,7 +246,7 @@ static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteA
246 246
247void AccountSettings::saveImapResource() 247void AccountSettings::saveImapResource()
248{ 248{
249 mImapIdentifier = saveResource<Sink::ApplicationDomain::ImapResource>(mAccountIdentifier, mImapIdentifier, { 249 mImapIdentifier = saveResource<ImapResource>(mAccountIdentifier, mImapIdentifier, {
250 {"server", mImapServer}, 250 {"server", mImapServer},
251 {"username", mImapUsername}, 251 {"username", mImapUsername},
252 {"password", mImapPassword}, 252 {"password", mImapPassword},
@@ -255,14 +255,14 @@ void AccountSettings::saveImapResource()
255 255
256void AccountSettings::saveMaildirResource() 256void AccountSettings::saveMaildirResource()
257{ 257{
258 mMaildirIdentifier = saveResource<Sink::ApplicationDomain::MaildirResource>(mAccountIdentifier, mMaildirIdentifier, { 258 mMaildirIdentifier = saveResource<MaildirResource>(mAccountIdentifier, mMaildirIdentifier, {
259 {"path", mPath}, 259 {"path", mPath},
260 }); 260 });
261} 261}
262 262
263void AccountSettings::saveMailtransportResource() 263void AccountSettings::saveMailtransportResource()
264{ 264{
265 mMailtransportIdentifier = saveResource<Sink::ApplicationDomain::MailtransportResource>(mAccountIdentifier, mMailtransportIdentifier, { 265 mMailtransportIdentifier = saveResource<MailtransportResource>(mAccountIdentifier, mMailtransportIdentifier, {
266 {"server", mSmtpServer}, 266 {"server", mSmtpServer},
267 {"username", mSmtpUsername}, 267 {"username", mSmtpUsername},
268 {"password", mSmtpPassword}, 268 {"password", mSmtpPassword},
@@ -272,22 +272,23 @@ void AccountSettings::saveMailtransportResource()
272void AccountSettings::saveIdentity() 272void AccountSettings::saveIdentity()
273{ 273{
274 if (!mIdentityIdentifier.isEmpty()) { 274 if (!mIdentityIdentifier.isEmpty()) {
275 Sink::ApplicationDomain::Identity identity(mMailtransportIdentifier); 275 Identity identity(mMailtransportIdentifier);
276 identity.setProperty("username", mUsername); 276 identity.setProperty("username", mUsername);
277 identity.setProperty("address", mEmailAddress); 277 identity.setProperty("address", mEmailAddress);
278 Sink::Store::modify(identity).then<void>([](){}, [](int errorCode, const QString &errorMessage) { 278 Store::modify(identity)
279 qWarning() << "Error while modifying identity: " << errorMessage; 279 .onError([](const KAsync::Error &error) {
280 qWarning() << "Error while modifying identity: " << error.errorMessage;
280 }) 281 })
281 .exec(); 282 .exec();
282 } else { 283 } else {
283 auto identity = Sink::ApplicationDomain::ApplicationDomainType::createEntity<Sink::ApplicationDomain::Identity>(); 284 auto identity = ApplicationDomainType::createEntity<Identity>();
284 mIdentityIdentifier = identity.identifier(); 285 mIdentityIdentifier = identity.identifier();
285 identity.setProperty("account", mAccountIdentifier); 286 identity.setAccount(mAccountIdentifier);
286 identity.setProperty("username", mUsername); 287 identity.setProperty("username", mUsername);
287 identity.setProperty("address", mEmailAddress); 288 identity.setProperty("address", mEmailAddress);
288 Sink::Store::create(identity).then<void>([]() {}, 289 Store::create(identity)
289 [](int errorCode, const QString &errorMessage) { 290 .onError([](const KAsync::Error &error) {
290 qWarning() << "Error while creating identity: " << errorMessage; 291 qWarning() << "Error while creating identity: " << error.errorMessage;
291 }) 292 })
292 .exec(); 293 .exec();
293 } 294 }
@@ -298,10 +299,10 @@ void AccountSettings::removeResource(const QByteArray &identifier)
298 if (identifier.isEmpty()) { 299 if (identifier.isEmpty()) {
299 qWarning() << "We're missing an identifier"; 300 qWarning() << "We're missing an identifier";
300 } else { 301 } else {
301 Sink::ApplicationDomain::SinkResource resource("", identifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); 302 SinkResource resource(identifier);
302 Sink::Store::remove(resource).template then<void>([]() {}, 303 Store::remove(resource)
303 [](int errorCode, const QString &errorMessage) { 304 .onError([](const KAsync::Error &error) {
304 qWarning() << "Error while removing resource: " << errorMessage; 305 qWarning() << "Error while removing resource: " << error.errorMessage;
305 }) 306 })
306 .exec(); 307 .exec();
307 } 308 }
@@ -312,10 +313,10 @@ void AccountSettings::removeAccount()
312 if (mAccountIdentifier.isEmpty()) { 313 if (mAccountIdentifier.isEmpty()) {
313 qWarning() << "We're missing an identifier"; 314 qWarning() << "We're missing an identifier";
314 } else { 315 } else {
315 Sink::ApplicationDomain::SinkAccount account("", mAccountIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); 316 SinkAccount account(mAccountIdentifier);
316 Sink::Store::remove(account).then<void>([]() {}, 317 Store::remove(account)
317 [](int errorCode, const QString &errorMessage) { 318 .onError([](const KAsync::Error &error) {
318 qWarning() << "Error while removing account: " << errorMessage; 319 qWarning() << "Error while removing account: " << error.errorMessage;
319 }) 320 })
320 .exec(); 321 .exec();
321 } 322 }
@@ -326,10 +327,10 @@ void AccountSettings::removeIdentity()
326 if (mIdentityIdentifier.isEmpty()) { 327 if (mIdentityIdentifier.isEmpty()) {
327 qWarning() << "We're missing an identifier"; 328 qWarning() << "We're missing an identifier";
328 } else { 329 } else {
329 Sink::ApplicationDomain::Identity identity("", mIdentityIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); 330 Identity identity(mIdentityIdentifier);
330 Sink::Store::remove(identity).then<void>([]() {}, 331 Store::remove(identity)
331 [](int errorCode, const QString &errorMessage) { 332 .onError([](const KAsync::Error &error) {
332 qWarning() << "Error while removing identity: " << errorMessage; 333 qWarning() << "Error while removing identity: " << error.errorMessage;
333 }) 334 })
334 .exec(); 335 .exec();
335 } 336 }
diff --git a/framework/settings/CMakeLists.txt b/framework/settings/CMakeLists.txt
index 9d876850..bf456138 100644
--- a/framework/settings/CMakeLists.txt
+++ b/framework/settings/CMakeLists.txt
@@ -1,8 +1,5 @@
1set(settingsplugin_SRCS 1set(settingsplugin_SRCS
2 settingsplugin.cpp 2 settingsplugin.cpp
3 # maildir_resource.cpp
4 # resourcelistmodel.cpp
5 # resourcescontroller.cpp
6 settings.cpp 3 settings.cpp
7) 4)
8 5
diff --git a/framework/settings/maildir_resource.cpp b/framework/settings/maildir_resource.cpp
deleted file mode 100644
index cb670295..00000000
--- a/framework/settings/maildir_resource.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
1#include "maildir_resource.h"
2
3MaildirResouceController::MaildirResouceController(QObject *parent) : QObject(parent)
4{
5
6}
7
8QString MaildirResouceController::name() const
9{
10 return m_name;
11}
12
13void MaildirResouceController::setName(const QString &name)
14{
15 if(m_name != name) {
16 m_name = name;
17 emit nameChanged();
18 }
19}
20
21QUrl MaildirResouceController::folderUrl() const
22{
23 return m_folderUrl;
24}
25
26void MaildirResouceController::setFolderUrl(const QUrl &url)
27{
28 if(m_folderUrl != url) {
29 m_folderUrl = url;
30 emit folderUrlChanged();
31 }
32}
diff --git a/framework/settings/maildir_resource.h b/framework/settings/maildir_resource.h
deleted file mode 100644
index 1db1a1f8..00000000
--- a/framework/settings/maildir_resource.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#pragma once
2
3#include <QObject>
4#include <QString>
5#include <QUrl>
6
7class MaildirResouceController : public QObject
8{
9 Q_OBJECT
10 Q_PROPERTY (QString name READ name WRITE setName NOTIFY nameChanged)
11 Q_PROPERTY (QUrl folderUrl READ folderUrl WRITE setFolderUrl NOTIFY folderUrlChanged);
12
13public:
14 explicit MaildirResouceController(QObject *parent = Q_NULLPTR);
15
16 QString name() const;
17 void setName(const QString &name);
18
19 QUrl folderUrl() const;
20 void setFolderUrl(const QUrl &url);
21
22signals:
23 void nameChanged();
24 void folderUrlChanged();
25
26private:
27 QString m_name;
28 QUrl m_folderUrl;
29}; \ No newline at end of file
diff --git a/framework/settings/resourcelistmodel.cpp b/framework/settings/resourcelistmodel.cpp
deleted file mode 100644
index 27063ebc..00000000
--- a/framework/settings/resourcelistmodel.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
1#include "resourcelistmodel.h"
2
3#include <sink/store.h>
4
5ResourceListModel::ResourceListModel(QObject *parent) : QIdentityProxyModel()
6{
7 Sink::Query query;
8 query.syncOnDemand = false;
9 query.processAll = false;
10 query.liveQuery = true;
11 query.requestedProperties << "type";
12 m_model = Sink::Store::loadModel<Sink::ApplicationDomain::SinkResource>(query);
13}
14
15ResourceListModel::~ResourceListModel()
16{
17
18}
19
20QHash< int, QByteArray > ResourceListModel::roleNames() const
21{
22 QHash<int, QByteArray> roles;
23
24 roles[Type] = "type";
25 roles[Id] = "id";
26
27 return roles;
28}
29
30QVariant ResourceListModel::data(const QModelIndex& index, int role) const
31{
32 auto srcIdx = mapToSource(index);
33 switch (role) {
34 case Id:
35 return srcIdx.data(Sink::Store::DomainObjectBaseRole).value<Sink::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier();
36 case Type:
37 return srcIdx.sibling(srcIdx.row(), 0).data(Qt::DisplayRole).toString();
38 }
39
40 return QIdentityProxyModel::data(index, role);
41}
42
diff --git a/framework/settings/resourcelistmodel.h b/framework/settings/resourcelistmodel.h
deleted file mode 100644
index de1b5a51..00000000
--- a/framework/settings/resourcelistmodel.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#pragma once
2
3#include <QIdentityProxyModel>
4#include <QSharedPointer>
5#include <QStringList>
6
7class ResourceListModel : public QIdentityProxyModel
8{
9 Q_OBJECT
10
11public:
12 ResourceListModel(QObject *parent = Q_NULLPTR);
13 ~ResourceListModel();
14
15 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
16
17 enum Roles {
18 Id = Qt::UserRole + 1,
19 Type
20 };
21
22 QHash<int, QByteArray> roleNames() const;
23
24private:
25 QSharedPointer<QAbstractItemModel> m_model;
26};
diff --git a/framework/settings/resourcescontroller.cpp b/framework/settings/resourcescontroller.cpp
deleted file mode 100644
index 03016b67..00000000
--- a/framework/settings/resourcescontroller.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
1#include "resourcescontroller.h"
2
3ResourcesController::ResourcesController(QObject *parent) : QObject(parent), m_model(new ResourceListModel())
4{
5
6}
7
8
9ResourceListModel* ResourcesController::model() const
10{
11 return m_model.data();
12}
diff --git a/framework/settings/resourcescontroller.h b/framework/settings/resourcescontroller.h
deleted file mode 100644
index 0e2e89de..00000000
--- a/framework/settings/resourcescontroller.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#pragma once
2
3#include "resourcelistmodel.h"
4
5#include <QObject>
6#include <QScopedPointer>
7
8class ResourcesController : public QObject
9{
10 Q_OBJECT
11 Q_PROPERTY (ResourceListModel *model READ model CONSTANT)
12
13public:
14 explicit ResourcesController(QObject *parent = Q_NULLPTR);
15
16 ResourceListModel *model() const;
17
18private:
19 QScopedPointer<ResourceListModel> m_model;
20};
diff --git a/framework/theme/CMakeLists.txt b/framework/theme/CMakeLists.txt
deleted file mode 100644
index 319e3d39..00000000
--- a/framework/theme/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
1set(themeplugin_SRCS
2 themeplugin.cpp
3 colorpalette.cpp
4 unit.cpp
5)
6
7add_library(themeplugin SHARED ${themeplugin_SRCS})
8
9qt5_use_modules(themeplugin Core Quick Qml)
10
11target_link_libraries(themeplugin)
12
13install(TARGETS themeplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/theme)
14install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/theme)
diff --git a/framework/theme/colorpalette.h b/framework/theme/colorpalette.h
deleted file mode 100644
index a06783f3..00000000
--- a/framework/theme/colorpalette.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#include <QObject>
20#include <QString>
21
22class ColorPalette : public QObject
23{
24 Q_OBJECT
25
26 Q_PROPERTY (QString background READ background NOTIFY themeChanged)
27 Q_PROPERTY (QString selected READ background NOTIFY themeChanged)
28 Q_PROPERTY (QString read READ read NOTIFY themeChanged)
29 Q_PROPERTY (QString border READ border NOTIFY themeChanged)
30
31public:
32 explicit ColorPalette(QObject *parent = Q_NULLPTR);
33
34 QString background() const;
35 QString selected() const;
36 QString read() const;
37 QString border() const;
38
39signals:
40 void themeChanged();
41
42private:
43 QString m_background;
44 QString m_selected;
45 QString m_read;
46 QString m_border;
47};
diff --git a/framework/theme/qmldir b/framework/theme/qmldir
deleted file mode 100644
index 489a71ca..00000000
--- a/framework/theme/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
1module org.kube.framework.theme
2
3plugin themeplugin
diff --git a/framework/theme/themeplugin.cpp b/framework/theme/themeplugin.cpp
deleted file mode 100644
index ad9d0e1b..00000000
--- a/framework/theme/themeplugin.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#include "themeplugin.h"
20
21#include <QtQml>
22#include <QQmlEngine>
23
24#include "colorpalette.h"
25#include "unit.h"
26
27static QObject *colorpaletteInstace(QQmlEngine *engine, QJSEngine *scriptEngine)
28{
29 Q_UNUSED(engine);
30 Q_UNUSED(scriptEngine);
31
32 return new ColorPalette;
33}
34
35static QObject *unitInstace(QQmlEngine *engine, QJSEngine *scriptEngine)
36{
37 Q_UNUSED(engine);
38 Q_UNUSED(scriptEngine);
39
40 return new Unit;
41}
42
43void ThemePlugin::registerTypes (const char *uri)
44{
45 Q_ASSERT(uri == QLatin1String("org.kube.framework.theme"));
46
47 qmlRegisterSingletonType<ColorPalette>(uri, 1, 0, "ColorPalette", colorpaletteInstace);
48 qmlRegisterSingletonType<Unit>(uri, 1, 0, "Unit", unitInstace);
49
50}