summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-15 18:30:45 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-19 17:09:58 +0200
commitfa8703974b98622f3f0dcd31cc1bdef554fb227b (patch)
tree1c35d5019c29ff0c63b2ff4e254482c162d24d26
parent2864cfb32b4df6d9b075aaae55e0304e333a42d1 (diff)
downloadkube-fa8703974b98622f3f0dcd31cc1bdef554fb227b.tar.gz
kube-fa8703974b98622f3f0dcd31cc1bdef554fb227b.zip
Cleanup
-rw-r--r--components/kube/contents/ui/MailView.qml5
-rw-r--r--framework/src/domain/identitiesmodel.cpp23
2 files changed, 13 insertions, 15 deletions
diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml
index 2bbe6652..da96bd28 100644
--- a/components/kube/contents/ui/MailView.qml
+++ b/components/kube/contents/ui/MailView.qml
@@ -79,11 +79,8 @@ SplitView {
79 id: border 79 id: border
80 anchors { 80 anchors {
81 right: parent.right 81 right: parent.right
82 rightMargin: Kube.Units.smallSpacing
83 left: parent.left 82 left: parent.left
84 leftMargin: Kube.Units.smallSpacing 83 margins: Kube.Units.smallSpacing
85 bottomMargin: Kube.Units.smallSpacing
86 topMargin: Kube.Units.smallSpacing
87 } 84 }
88 height: 1 85 height: 1
89 color: Kube.Colors.viewBackgroundColor 86 color: Kube.Colors.viewBackgroundColor
diff --git a/framework/src/domain/identitiesmodel.cpp b/framework/src/domain/identitiesmodel.cpp
index 0d97fc6a..029c6b00 100644
--- a/framework/src/domain/identitiesmodel.cpp
+++ b/framework/src/domain/identitiesmodel.cpp
@@ -25,10 +25,10 @@ using namespace Sink;
25IdentitiesModel::IdentitiesModel(QObject *parent) : QIdentityProxyModel() 25IdentitiesModel::IdentitiesModel(QObject *parent) : QIdentityProxyModel()
26{ 26{
27 Sink::Query query; 27 Sink::Query query;
28 query.setFlags(Sink::Query::LiveQuery); 28 query.setFlags(Query::LiveQuery);
29 query.request<Sink::ApplicationDomain::Identity::Name>() 29 query.request<ApplicationDomain::Identity::Name>()
30 .request<Sink::ApplicationDomain::Identity::Address>() 30 .request<ApplicationDomain::Identity::Address>()
31 .request<Sink::ApplicationDomain::Identity::Account>(); 31 .request<ApplicationDomain::Identity::Account>();
32 runQuery(query); 32 runQuery(query);
33} 33}
34 34
@@ -56,23 +56,24 @@ QHash< int, QByteArray > IdentitiesModel::roleNames() const
56QVariant IdentitiesModel::data(const QModelIndex &idx, int role) const 56QVariant IdentitiesModel::data(const QModelIndex &idx, int role) const
57{ 57{
58 auto srcIdx = mapToSource(idx); 58 auto srcIdx = mapToSource(idx);
59 auto identity = srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>();
59 switch (role) { 60 switch (role) {
60 case Name: 61 case Name:
61 return srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>()->getName(); 62 return identity->getName();
62 case Username: 63 case Username:
63 return srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>()->getName(); 64 return identity->getName();
64 case Address: 65 case Address:
65 return srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>()->getAddress(); 66 return identity->getAddress();
66 case IdentityId: 67 case IdentityId:
67 return srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>()->identifier(); 68 return identity->identifier();
68 case AccountId: 69 case AccountId:
69 return srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>()->getAccount(); 70 return identity->getAccount();
70 case AccountName: { 71 case AccountName: {
71 const auto accountId = srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>()->getAccount(); 72 const auto accountId = identity->getAccount();
72 return mAccountNames.value(accountId); 73 return mAccountNames.value(accountId);
73 } 74 }
74 case AccountIcon: { 75 case AccountIcon: {
75 const auto accountId = srcIdx.data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Identity::Ptr>()->getAccount(); 76 const auto accountId = identity->getAccount();
76 return mAccountIcons.value(accountId); 77 return mAccountIcons.value(accountId);
77 } 78 }
78 case DisplayName: { 79 case DisplayName: {