summaryrefslogtreecommitdiffstats
path: root/framework/domain/accountfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/domain/accountfactory.cpp')
-rw-r--r--framework/domain/accountfactory.cpp19
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
29AccountFactory::AccountFactory(QObject *parent) 30AccountFactory::AccountFactory(QObject *parent)
30 : QObject(parent) 31 : QObject(parent)
31{ 32{
32} 33}
33 34
35QString AccountFactory::name() const
36{
37 if (mName.isEmpty()) {
38 return tr("Account");
39 }
40 return mName;
41}
42
34void AccountFactory::setAccountId(const QString &accountId) 43void 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
44void AccountFactory::loadPackage() 53void AccountFactory::loadPackage()