diff options
Diffstat (limited to 'framework/domain/accountfactory.cpp')
-rw-r--r-- | framework/domain/accountfactory.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/framework/domain/accountfactory.cpp b/framework/domain/accountfactory.cpp index ab1a09e5..10f01f65 100644 --- a/framework/domain/accountfactory.cpp +++ b/framework/domain/accountfactory.cpp | |||
@@ -25,20 +25,29 @@ | |||
25 | #include <KPluginMetaData> | 25 | #include <KPluginMetaData> |
26 | 26 | ||
27 | #include "settings/settings.h" | 27 | #include "settings/settings.h" |
28 | #include <sink/store.h> | ||
28 | 29 | ||
29 | AccountFactory::AccountFactory(QObject *parent) | 30 | AccountFactory::AccountFactory(QObject *parent) |
30 | : QObject(parent) | 31 | : QObject(parent) |
31 | { | 32 | { |
32 | } | 33 | } |
33 | 34 | ||
35 | QString AccountFactory::name() const | ||
36 | { | ||
37 | if (mName.isEmpty()) { | ||
38 | return tr("Account"); | ||
39 | } | ||
40 | return mName; | ||
41 | } | ||
42 | |||
34 | void AccountFactory::setAccountId(const QString &accountId) | 43 | void AccountFactory::setAccountId(const QString &accountId) |
35 | { | 44 | { |
36 | mAccountId = accountId; | 45 | mAccountId = accountId; |
37 | 46 | Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query::IdentityFilter(accountId.toUtf8())) | |
38 | Kube::Account account(mAccountId.toUtf8()); | 47 | .then<void, Sink::ApplicationDomain::SinkAccount>([this](const Sink::ApplicationDomain::SinkAccount &account) { |
39 | mAccountType = account.type(); | 48 | mAccountType = account.getProperty("type").toByteArray(); |
40 | 49 | loadPackage(); | |
41 | loadPackage(); | 50 | }).exec(); |
42 | } | 51 | } |
43 | 52 | ||
44 | void AccountFactory::loadPackage() | 53 | void AccountFactory::loadPackage() |