summaryrefslogtreecommitdiffstats
path: root/framework/accounts/maildircontroller.cpp
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-01-05 15:58:47 +0100
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-01-05 15:58:47 +0100
commitaba4edffe5a0e98ed92bb0177e89f6936c7eeb1f (patch)
tree80cdb282194b67ccdb468308f55dab3b061dc3ca /framework/accounts/maildircontroller.cpp
parent2ea57b9a9c5db3fa340cb62d40a9732af31143e0 (diff)
downloadkube-aba4edffe5a0e98ed92bb0177e89f6936c7eeb1f.tar.gz
kube-aba4edffe5a0e98ed92bb0177e89f6936c7eeb1f.zip
maildir controller based on the new kubecontroller + adjusted create-maildir-ui
Diffstat (limited to 'framework/accounts/maildircontroller.cpp')
-rw-r--r--framework/accounts/maildircontroller.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/framework/accounts/maildircontroller.cpp b/framework/accounts/maildircontroller.cpp
new file mode 100644
index 00000000..daafccb6
--- /dev/null
+++ b/framework/accounts/maildircontroller.cpp
@@ -0,0 +1,55 @@
1/*
2 Copyright (C) 2017 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 "maildircontroller.h"
20
21#include <sink/store.h>
22
23using namespace Sink;
24using namespace Sink::ApplicationDomain;
25
26MaildirController::MaildirController() : Kube::Controller(),
27 action_create{new Kube::ControllerAction{this, &MaildirController::create}},
28 action_modify{new Kube::ControllerAction{this, &MaildirController::modify}},
29 action_remove{new Kube::ControllerAction{this, &MaildirController::remove}}
30{
31
32}
33
34void MaildirController::create() {
35 auto account = ApplicationDomainType::createEntity<SinkAccount>();
36 account.setProperty("type", "maildir");
37 account.setProperty("name", getName());
38 //account.setProperty("icon", getIcon());
39 Store::create(account).exec().waitForFinished();
40
41 auto resource = ApplicationDomainType::createEntity<SinkResource>();
42 resource.setResourceType("sink.maildir");
43 resource.setAccount(account);
44 resource.setProperty("path", getPath().path());
45
46 Store::create(resource).exec().waitForFinished();
47
48 clear();
49}
50
51void MaildirController::modify() {
52}
53
54void MaildirController::remove() {
55}