diff options
Diffstat (limited to 'framework/src/domain/actions/sinkactions.cpp')
-rw-r--r-- | framework/src/domain/actions/sinkactions.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/framework/src/domain/actions/sinkactions.cpp b/framework/src/domain/actions/sinkactions.cpp deleted file mode 100644 index 460cb6a1..00000000 --- a/framework/src/domain/actions/sinkactions.cpp +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com> | ||
3 | |||
4 | This library is free software; you can redistribute it and/or modify it | ||
5 | under the terms of the GNU Library General Public License as published by | ||
6 | the Free Software Foundation; either version 2 of the License, or (at your | ||
7 | option) any later version. | ||
8 | |||
9 | This library is distributed in the hope that it will be useful, but WITHOUT | ||
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||
12 | License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to the | ||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #include <actions/actionhandler.h> | ||
21 | |||
22 | #include <KMime/Message> | ||
23 | #include <QFile> | ||
24 | |||
25 | #include <sink/store.h> | ||
26 | #include <sink/log.h> | ||
27 | |||
28 | SINK_DEBUG_AREA("sinkactions") | ||
29 | |||
30 | using namespace Kube; | ||
31 | using namespace Sink; | ||
32 | using namespace Sink::ApplicationDomain; | ||
33 | |||
34 | class FolderContext : public Kube::ContextWrapper { | ||
35 | using Kube::ContextWrapper::ContextWrapper; | ||
36 | KUBE_CONTEXTWRAPPER_PROPERTY(Sink::ApplicationDomain::Folder::Ptr, Folder, folder) | ||
37 | }; | ||
38 | |||
39 | static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize", | ||
40 | [](Context *context) -> bool { | ||
41 | return true; | ||
42 | }, | ||
43 | [](Context *context_) { | ||
44 | auto context = FolderContext{*context_}; | ||
45 | if (auto folder = context.getFolder()) { | ||
46 | SinkLog() << "Synchronizing folder " << folder->resourceInstanceIdentifier() << folder->identifier(); | ||
47 | auto scope = SyncScope().resourceFilter(folder->resourceInstanceIdentifier()).filter<Mail::Folder>(QVariant::fromValue(folder->identifier())); | ||
48 | scope.setType<ApplicationDomain::Mail>(); | ||
49 | Store::synchronize(scope).exec(); | ||
50 | } else { | ||
51 | SinkLog() << "Synchronizing all"; | ||
52 | Store::synchronize(SyncScope()).exec(); | ||
53 | } | ||
54 | } | ||
55 | ); | ||
56 | |||