From fa8703974b98622f3f0dcd31cc1bdef554fb227b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 15 May 2017 18:30:45 +0200 Subject: Cleanup --- framework/src/domain/identitiesmodel.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'framework/src/domain/identitiesmodel.cpp') 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