diff options
Diffstat (limited to 'framework/mail')
-rw-r--r-- | framework/mail/CMakeLists.txt | 4 | ||||
-rw-r--r-- | framework/mail/actions/sinkactions.cpp (renamed from framework/mail/actions/akonadiactions.cpp) | 12 | ||||
-rw-r--r-- | framework/mail/actions/sinkactions.h (renamed from framework/mail/actions/akonadiactions.h) | 0 | ||||
-rw-r--r-- | framework/mail/folderlistcontroller.cpp | 2 | ||||
-rw-r--r-- | framework/mail/folderlistmodel.cpp | 12 | ||||
-rw-r--r-- | framework/mail/maillistcontroller.cpp | 10 | ||||
-rw-r--r-- | framework/mail/maillistmodel.cpp | 16 | ||||
-rw-r--r-- | framework/mail/maillistmodel.h | 4 | ||||
-rw-r--r-- | framework/mail/singlemailcontroller.cpp | 2 |
9 files changed, 31 insertions, 31 deletions
diff --git a/framework/mail/CMakeLists.txt b/framework/mail/CMakeLists.txt index 9a32cc83..0a0e0ac6 100644 --- a/framework/mail/CMakeLists.txt +++ b/framework/mail/CMakeLists.txt | |||
@@ -5,7 +5,7 @@ set(mailplugin_SRCS | |||
5 | singlemailcontroller.cpp | 5 | singlemailcontroller.cpp |
6 | folderlistmodel.cpp | 6 | folderlistmodel.cpp |
7 | folderlistcontroller.cpp | 7 | folderlistcontroller.cpp |
8 | actions/akonadiactions.cpp | 8 | actions/sinkactions.cpp |
9 | objecttreesource.cpp | 9 | objecttreesource.cpp |
10 | stringhtmlwriter.cpp | 10 | stringhtmlwriter.cpp |
11 | ) | 11 | ) |
@@ -14,7 +14,7 @@ add_library(mailplugin SHARED ${mailplugin_SRCS}) | |||
14 | 14 | ||
15 | qt5_use_modules(mailplugin Core Quick Qml) | 15 | qt5_use_modules(mailplugin Core Quick Qml) |
16 | 16 | ||
17 | target_link_libraries(mailplugin actionplugin KF5::akonadi2common KF5::Otp actionplugin) | 17 | target_link_libraries(mailplugin actionplugin Sink KF5::Otp) |
18 | 18 | ||
19 | install(TARGETS mailplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) | 19 | install(TARGETS mailplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) |
20 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) | 20 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) |
diff --git a/framework/mail/actions/akonadiactions.cpp b/framework/mail/actions/sinkactions.cpp index d0a51deb..8918f996 100644 --- a/framework/mail/actions/akonadiactions.cpp +++ b/framework/mail/actions/sinkactions.cpp | |||
@@ -16,11 +16,11 @@ | |||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
17 | 02110-1301, USA. | 17 | 02110-1301, USA. |
18 | */ | 18 | */ |
19 | #include "akonadiactions.h" | 19 | #include "sinkactions.h" |
20 | 20 | ||
21 | #include <actions/context.h> | 21 | #include <actions/context.h> |
22 | 22 | ||
23 | #include <akonadi2common/clientapi.h> | 23 | #include <sinkcommon/clientapi.h> |
24 | 24 | ||
25 | using namespace Kube; | 25 | using namespace Kube; |
26 | 26 | ||
@@ -47,14 +47,14 @@ static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read" | |||
47 | return context->property("mail").isValid(); | 47 | return context->property("mail").isValid(); |
48 | }, | 48 | }, |
49 | [](Context *context) { | 49 | [](Context *context) { |
50 | auto mail = context->property("mail").value<Akonadi2::ApplicationDomain::Mail::Ptr>(); | 50 | auto mail = context->property("mail").value<Sink::ApplicationDomain::Mail::Ptr>(); |
51 | if (!mail) { | 51 | if (!mail) { |
52 | qWarning() << "Failed to get the mail mail: " << context->property("mail"); | 52 | qWarning() << "Failed to get the mail mail: " << context->property("mail"); |
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | mail->setProperty("unread", false); | 55 | mail->setProperty("unread", false); |
56 | qDebug() << "Mark as read " << mail->identifier(); | 56 | qDebug() << "Mark as read " << mail->identifier(); |
57 | Akonadi2::Store::modify(*mail).exec(); | 57 | Sink::Store::modify(*mail).exec(); |
58 | } | 58 | } |
59 | ); | 59 | ); |
60 | 60 | ||
@@ -63,13 +63,13 @@ static ActionHandlerHelper deleteHandler("org.kde.kube.actions.delete", | |||
63 | return context->property("mail").isValid(); | 63 | return context->property("mail").isValid(); |
64 | }, | 64 | }, |
65 | [](Context *context) { | 65 | [](Context *context) { |
66 | auto mail = context->property("mail").value<Akonadi2::ApplicationDomain::Mail::Ptr>(); | 66 | auto mail = context->property("mail").value<Sink::ApplicationDomain::Mail::Ptr>(); |
67 | if (!mail) { | 67 | if (!mail) { |
68 | qWarning() << "Failed to get the mail mail: " << context->property("mail"); | 68 | qWarning() << "Failed to get the mail mail: " << context->property("mail"); |
69 | return; | 69 | return; |
70 | } | 70 | } |
71 | mail->setProperty("unread", false); | 71 | mail->setProperty("unread", false); |
72 | qDebug() << "Remove " << mail->identifier(); | 72 | qDebug() << "Remove " << mail->identifier(); |
73 | Akonadi2::Store::remove(*mail).exec(); | 73 | Sink::Store::remove(*mail).exec(); |
74 | } | 74 | } |
75 | ); | 75 | ); |
diff --git a/framework/mail/actions/akonadiactions.h b/framework/mail/actions/sinkactions.h index a583ebf8..a583ebf8 100644 --- a/framework/mail/actions/akonadiactions.h +++ b/framework/mail/actions/sinkactions.h | |||
diff --git a/framework/mail/folderlistcontroller.cpp b/framework/mail/folderlistcontroller.cpp index 3b1cf9f8..46a6f648 100644 --- a/framework/mail/folderlistcontroller.cpp +++ b/framework/mail/folderlistcontroller.cpp | |||
@@ -52,7 +52,7 @@ FolderListModel* FolderListController::model() const | |||
52 | 52 | ||
53 | void FolderListController::loadFolders(const QString &id) | 53 | void FolderListController::loadFolders(const QString &id) |
54 | { | 54 | { |
55 | //load foldermodel from akonadi | 55 | //load foldermodel from sink |
56 | 56 | ||
57 | } | 57 | } |
58 | 58 | ||
diff --git a/framework/mail/folderlistmodel.cpp b/framework/mail/folderlistmodel.cpp index 204dfdbf..645ecc30 100644 --- a/framework/mail/folderlistmodel.cpp +++ b/framework/mail/folderlistmodel.cpp | |||
@@ -19,17 +19,17 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include "folderlistmodel.h" | 21 | #include "folderlistmodel.h" |
22 | #include <akonadi2common/clientapi.h> | 22 | #include <sinkcommon/clientapi.h> |
23 | #include <akonadi2common/applicationdomaintype.h> | 23 | #include <sinkcommon/applicationdomaintype.h> |
24 | 24 | ||
25 | FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() | 25 | FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() |
26 | { | 26 | { |
27 | Akonadi2::Query query; | 27 | Sink::Query query; |
28 | query.syncOnDemand = false; | 28 | query.syncOnDemand = false; |
29 | query.processAll = false; | 29 | query.processAll = false; |
30 | query.liveQuery = true; | 30 | query.liveQuery = true; |
31 | query.requestedProperties << "name" << "icon"; | 31 | query.requestedProperties << "name" << "icon"; |
32 | mModel = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); | 32 | mModel = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); |
33 | setSourceModel(mModel.data()); | 33 | setSourceModel(mModel.data()); |
34 | } | 34 | } |
35 | 35 | ||
@@ -59,9 +59,9 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const | |||
59 | case Icon: | 59 | case Icon: |
60 | return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); | 60 | return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); |
61 | case Id: | 61 | case Id: |
62 | return srcIdx.data(Akonadi2::Store::DomainObjectBaseRole).value<Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier(); | 62 | return srcIdx.data(Sink::Store::DomainObjectBaseRole).value<Sink::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier(); |
63 | case DomainObject: | 63 | case DomainObject: |
64 | return srcIdx.data(Akonadi2::Store::DomainObjectRole); | 64 | return srcIdx.data(Sink::Store::DomainObjectRole); |
65 | } | 65 | } |
66 | return QIdentityProxyModel::data(idx, role); | 66 | return QIdentityProxyModel::data(idx, role); |
67 | } | 67 | } |
diff --git a/framework/mail/maillistcontroller.cpp b/framework/mail/maillistcontroller.cpp index ed353b70..b342b1ec 100644 --- a/framework/mail/maillistcontroller.cpp +++ b/framework/mail/maillistcontroller.cpp | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #include <QStringList> | 23 | #include <QStringList> |
24 | 24 | ||
25 | #include <akonadi2common/clientapi.h> | 25 | #include <sinkcommon/clientapi.h> |
26 | 26 | ||
27 | #include "maillistmodel.h" | 27 | #include "maillistmodel.h" |
28 | 28 | ||
@@ -38,7 +38,7 @@ MailListModel *MailListController::model() const | |||
38 | 38 | ||
39 | void MailListController::loadAllMail() | 39 | void MailListController::loadAllMail() |
40 | { | 40 | { |
41 | Akonadi2::Query query; | 41 | Sink::Query query; |
42 | query.syncOnDemand = false; | 42 | query.syncOnDemand = false; |
43 | query.processAll = false; | 43 | query.processAll = false; |
44 | query.liveQuery = true; | 44 | query.liveQuery = true; |
@@ -48,7 +48,7 @@ void MailListController::loadAllMail() | |||
48 | 48 | ||
49 | void MailListController::loadMailFolder(const QString &folderId) | 49 | void MailListController::loadMailFolder(const QString &folderId) |
50 | { | 50 | { |
51 | Akonadi2::Query query; | 51 | Sink::Query query; |
52 | query.syncOnDemand = false; | 52 | query.syncOnDemand = false; |
53 | query.processAll = false; | 53 | query.processAll = false; |
54 | query.liveQuery = true; | 54 | query.liveQuery = true; |
@@ -59,7 +59,7 @@ void MailListController::loadMailFolder(const QString &folderId) | |||
59 | 59 | ||
60 | void MailListController::loadUnreadMail() | 60 | void MailListController::loadUnreadMail() |
61 | { | 61 | { |
62 | Akonadi2::Query query; | 62 | Sink::Query query; |
63 | query.syncOnDemand = false; | 63 | query.syncOnDemand = false; |
64 | query.processAll = false; | 64 | query.processAll = false; |
65 | query.liveQuery = true; | 65 | query.liveQuery = true; |
@@ -70,7 +70,7 @@ void MailListController::loadUnreadMail() | |||
70 | 70 | ||
71 | void MailListController::loadImportantMail() | 71 | void MailListController::loadImportantMail() |
72 | { | 72 | { |
73 | Akonadi2::Query query; | 73 | Sink::Query query; |
74 | query.syncOnDemand = false; | 74 | query.syncOnDemand = false; |
75 | query.processAll = false; | 75 | query.processAll = false; |
76 | query.liveQuery = true; | 76 | query.liveQuery = true; |
diff --git a/framework/mail/maillistmodel.cpp b/framework/mail/maillistmodel.cpp index 2314e155..e43351b0 100644 --- a/framework/mail/maillistmodel.cpp +++ b/framework/mail/maillistmodel.cpp | |||
@@ -74,9 +74,9 @@ QVariant MailListModel::data(const QModelIndex &idx, int role) const | |||
74 | case Important: | 74 | case Important: |
75 | return srcIdx.sibling(srcIdx.row(), 5).data(Qt::DisplayRole).toString(); | 75 | return srcIdx.sibling(srcIdx.row(), 5).data(Qt::DisplayRole).toString(); |
76 | case Id: | 76 | case Id: |
77 | return srcIdx.data(Akonadi2::Store::DomainObjectBaseRole).value<Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier(); | 77 | return srcIdx.data(Sink::Store::DomainObjectBaseRole).value<Sink::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier(); |
78 | case DomainObject: | 78 | case DomainObject: |
79 | return srcIdx.data(Akonadi2::Store::DomainObjectRole); | 79 | return srcIdx.data(Sink::Store::DomainObjectRole); |
80 | case MimeMessage: { | 80 | case MimeMessage: { |
81 | auto filename = srcIdx.sibling(srcIdx.row(), 6).data(Qt::DisplayRole).toString(); | 81 | auto filename = srcIdx.sibling(srcIdx.row(), 6).data(Qt::DisplayRole).toString(); |
82 | QFile file(filename); | 82 | QFile file(filename); |
@@ -123,20 +123,20 @@ QVariant MailListModel::data(const QModelIndex &idx, int role) const | |||
123 | return QIdentityProxyModel::data(idx, role); | 123 | return QIdentityProxyModel::data(idx, role); |
124 | } | 124 | } |
125 | 125 | ||
126 | void MailListModel::runQuery(const Akonadi2::Query &query) | 126 | void MailListModel::runQuery(const Sink::Query &query) |
127 | { | 127 | { |
128 | m_model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | 128 | m_model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); |
129 | setSourceModel(m_model.data()); | 129 | setSourceModel(m_model.data()); |
130 | } | 130 | } |
131 | 131 | ||
132 | void MailListModel::setParentFolder(const QVariant &parentFolder) | 132 | void MailListModel::setParentFolder(const QVariant &parentFolder) |
133 | { | 133 | { |
134 | auto folder = parentFolder.value<Akonadi2::ApplicationDomain::Folder::Ptr>(); | 134 | auto folder = parentFolder.value<Sink::ApplicationDomain::Folder::Ptr>(); |
135 | if (!folder) { | 135 | if (!folder) { |
136 | qWarning() << "No folder: " << parentFolder; | 136 | qWarning() << "No folder: " << parentFolder; |
137 | return; | 137 | return; |
138 | } | 138 | } |
139 | Akonadi2::Query query; | 139 | Sink::Query query; |
140 | query.syncOnDemand = false; | 140 | query.syncOnDemand = false; |
141 | query.processAll = false; | 141 | query.processAll = false; |
142 | query.liveQuery = true; | 142 | query.liveQuery = true; |
@@ -154,12 +154,12 @@ QVariant MailListModel::parentFolder() const | |||
154 | 154 | ||
155 | void MailListModel::setMail(const QVariant &variant) | 155 | void MailListModel::setMail(const QVariant &variant) |
156 | { | 156 | { |
157 | auto mail = variant.value<Akonadi2::ApplicationDomain::Mail::Ptr>(); | 157 | auto mail = variant.value<Sink::ApplicationDomain::Mail::Ptr>(); |
158 | if (!mail) { | 158 | if (!mail) { |
159 | qWarning() << "No mail: " << mail; | 159 | qWarning() << "No mail: " << mail; |
160 | return; | 160 | return; |
161 | } | 161 | } |
162 | Akonadi2::Query query; | 162 | Sink::Query query; |
163 | query.syncOnDemand = false; | 163 | query.syncOnDemand = false; |
164 | query.processAll = false; | 164 | query.processAll = false; |
165 | query.liveQuery = false; | 165 | query.liveQuery = false; |
diff --git a/framework/mail/maillistmodel.h b/framework/mail/maillistmodel.h index 1d56e6b8..6593a59c 100644 --- a/framework/mail/maillistmodel.h +++ b/framework/mail/maillistmodel.h | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #pragma once | 21 | #pragma once |
22 | 22 | ||
23 | #include <akonadi2common/clientapi.h> | 23 | #include <sinkcommon/clientapi.h> |
24 | 24 | ||
25 | #include <QIdentityProxyModel> | 25 | #include <QIdentityProxyModel> |
26 | #include <QSharedPointer> | 26 | #include <QSharedPointer> |
@@ -53,7 +53,7 @@ public: | |||
53 | 53 | ||
54 | QHash<int, QByteArray> roleNames() const; | 54 | QHash<int, QByteArray> roleNames() const; |
55 | 55 | ||
56 | void runQuery(const Akonadi2::Query &query); | 56 | void runQuery(const Sink::Query &query); |
57 | 57 | ||
58 | void setParentFolder(const QVariant &parentFolder); | 58 | void setParentFolder(const QVariant &parentFolder); |
59 | QVariant parentFolder() const; | 59 | QVariant parentFolder() const; |
diff --git a/framework/mail/singlemailcontroller.cpp b/framework/mail/singlemailcontroller.cpp index 5f7a6d93..d0ab9f3c 100644 --- a/framework/mail/singlemailcontroller.cpp +++ b/framework/mail/singlemailcontroller.cpp | |||
@@ -38,7 +38,7 @@ MailListModel* SingleMailController::model() const | |||
38 | 38 | ||
39 | void SingleMailController::loadMail(const QString &id) | 39 | void SingleMailController::loadMail(const QString &id) |
40 | { | 40 | { |
41 | Akonadi2::Query query; | 41 | Sink::Query query; |
42 | query.syncOnDemand = false; | 42 | query.syncOnDemand = false; |
43 | query.processAll = false; | 43 | query.processAll = false; |
44 | query.liveQuery = false; | 44 | query.liveQuery = false; |