From 8cf790d6bc91e5e9c06651ffe4a193b625207f0d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 1 Jan 2017 23:18:24 +0100 Subject: Outboxcontroller and Mailcontroller --- framework/domain/actions/sinkactions.cpp | 62 -------------------------------- 1 file changed, 62 deletions(-) (limited to 'framework/domain/actions/sinkactions.cpp') diff --git a/framework/domain/actions/sinkactions.cpp b/framework/domain/actions/sinkactions.cpp index a2d4c02c..460cb6a1 100644 --- a/framework/domain/actions/sinkactions.cpp +++ b/framework/domain/actions/sinkactions.cpp @@ -31,53 +31,6 @@ using namespace Kube; using namespace Sink; using namespace Sink::ApplicationDomain; -static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read", - [](Context *context) -> bool { - return context->property("mail").isValid(); - }, - [](Context *context) { - auto mail = context->property("mail").value(); - if (!mail) { - SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); - return; - } - mail->setProperty("unread", false); - SinkLog() << "Mark as read " << mail->identifier(); - Store::modify(*mail).exec(); - } -); - -static ActionHandlerHelper moveToTrashHandler("org.kde.kube.actions.move-to-trash", - [](Context *context) -> bool { - return context->property("mail").isValid(); - }, - [](Context *context) { - auto mail = context->property("mail").value(); - if (!mail) { - SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); - return; - } - mail->setTrash(true); - SinkLog() << "Move to trash " << mail->identifier(); - Store::modify(*mail).exec(); - } -); - -static ActionHandlerHelper deleteHandler("org.kde.kube.actions.delete", - [](Context *context) -> bool { - return context->property("mail").isValid(); - }, - [](Context *context) { - auto mail = context->property("mail").value(); - if (!mail) { - SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); - return; - } - SinkLog() << "Remove " << mail->identifier(); - Store::remove(*mail).exec(); - } -); - class FolderContext : public Kube::ContextWrapper { using Kube::ContextWrapper::ContextWrapper; KUBE_CONTEXTWRAPPER_PROPERTY(Sink::ApplicationDomain::Folder::Ptr, Folder, folder) @@ -101,18 +54,3 @@ static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize" } ); -static ActionHandlerHelper sendOutboxHandler("org.kde.kube.actions.sendOutbox", - [](Context *context) -> bool { - return true; - }, - ActionHandlerHelper::JobHandler{[](Context *context) -> KAsync::Job { - using namespace Sink::ApplicationDomain; - Query query; - query.containsFilter(ResourceCapabilities::Mail::transport); - return Store::fetchAll(query) - .each([=](const SinkResource::Ptr &resource) -> KAsync::Job { - return Store::synchronize(SyncScope{}.resourceFilter(resource->identifier())); - }); - }} -); - -- cgit v1.2.3