diff options
Diffstat (limited to 'framework/domain/accountscontroller.cpp')
-rw-r--r-- | framework/domain/accountscontroller.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/framework/domain/accountscontroller.cpp b/framework/domain/accountscontroller.cpp deleted file mode 100644 index 5cb60d0c..00000000 --- a/framework/domain/accountscontroller.cpp +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net> | ||
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 | |||
21 | #include "accountscontroller.h" | ||
22 | |||
23 | #include <settings/settings.h> | ||
24 | #include <sink/store.h> | ||
25 | |||
26 | #include <QVariant> | ||
27 | #include <QDebug> | ||
28 | |||
29 | AccountsController::AccountsController(QObject *parent) : QObject(parent) | ||
30 | { | ||
31 | } | ||
32 | |||
33 | void AccountsController::createAccount(const QString &accountType) | ||
34 | { | ||
35 | auto account = Sink::ApplicationDomain::ApplicationDomainType::createEntity<Sink::ApplicationDomain::SinkAccount>(); | ||
36 | account.setProperty("type", accountType); | ||
37 | Sink::Store::create(account).syncThen<void>([](const KAsync::Error &error) { | ||
38 | if (error) { | ||
39 | qWarning() << "Error while creating account: " << error.errorMessage; | ||
40 | } | ||
41 | }).exec(); | ||
42 | } | ||