From fa8703974b98622f3f0dcd31cc1bdef554fb227b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 15 May 2017 18:30:45 +0200 Subject: Cleanup --- components/kube/contents/ui/MailView.qml | 5 +---- framework/src/domain/identitiesmodel.cpp | 23 ++++++++++++----------- 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 { id: border anchors { right: parent.right - rightMargin: Kube.Units.smallSpacing left: parent.left - leftMargin: Kube.Units.smallSpacing - bottomMargin: Kube.Units.smallSpacing - topMargin: Kube.Units.smallSpacing + margins: Kube.Units.smallSpacing } height: 1 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; IdentitiesModel::IdentitiesModel(QObject *parent) : QIdentityProxyModel() { Sink::Query query; - query.setFlags(Sink::Query::LiveQuery); - query.request() - .request() - .request(); + query.setFlags(Query::LiveQuery); + query.request() + .request() + .request(); runQuery(query); } @@ -56,23 +56,24 @@ QHash< int, QByteArray > IdentitiesModel::roleNames() const QVariant IdentitiesModel::data(const QModelIndex &idx, int role) const { auto srcIdx = mapToSource(idx); + auto identity = srcIdx.data(Sink::Store::DomainObjectRole).value(); switch (role) { case Name: - return srcIdx.data(Sink::Store::DomainObjectRole).value()->getName(); + return identity->getName(); case Username: - return srcIdx.data(Sink::Store::DomainObjectRole).value()->getName(); + return identity->getName(); case Address: - return srcIdx.data(Sink::Store::DomainObjectRole).value()->getAddress(); + return identity->getAddress(); case IdentityId: - return srcIdx.data(Sink::Store::DomainObjectRole).value()->identifier(); + return identity->identifier(); case AccountId: - return srcIdx.data(Sink::Store::DomainObjectRole).value()->getAccount(); + return identity->getAccount(); case AccountName: { - const auto accountId = srcIdx.data(Sink::Store::DomainObjectRole).value()->getAccount(); + const auto accountId = identity->getAccount(); return mAccountNames.value(accountId); } case AccountIcon: { - const auto accountId = srcIdx.data(Sink::Store::DomainObjectRole).value()->getAccount(); + const auto accountId = identity->getAccount(); return mAccountIcons.value(accountId); } case DisplayName: { -- cgit v1.2.3