From c3040251dd4d9e8d00cbccdeb693b11a72077c73 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 13 Apr 2016 10:58:20 +0200 Subject: Fixed identity lookup --- common/domain/applicationdomaintype.h | 3 +++ common/store.cpp | 2 +- tests/accountstest.cpp | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 55207d0..c94a987 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -193,6 +193,9 @@ QByteArray SINK_EXPORT getTypeName(); template<> QByteArray SINK_EXPORT getTypeName(); +template<> +QByteArray SINK_EXPORT getTypeName(); + template<> QByteArray SINK_EXPORT getTypeName(); diff --git a/common/store.cpp b/common/store.cpp index 02d868f..0321583 100644 --- a/common/store.cpp +++ b/common/store.cpp @@ -54,7 +54,7 @@ QString Store::getTemporaryFilePath() static QList getResources(const QList &resourceFilter, const QByteArray &type = QByteArray()) { // Return the global resource (signified by an empty name) for types that don't belong to a specific resource - if (type == "sinkresource" || type == "sinkaccount") { + if (type == "sinkresource" || type == "sinkaccount" || type == "identity") { return QList() << ""; } QList resources; diff --git a/tests/accountstest.cpp b/tests/accountstest.cpp index 6f109f8..12e4685 100644 --- a/tests/accountstest.cpp +++ b/tests/accountstest.cpp @@ -68,6 +68,18 @@ private slots: }) .exec().waitForFinished(); + auto identity = ApplicationDomainType::createEntity(); + identity.setProperty("name", smtpServer); + identity.setProperty("address", smtpUsername); + identity.setProperty("account", account.identifier()); + Store::create(identity).exec().waitForFinished(); + + Store::fetchAll(Query()).then>([&](const QList &identities) { + QCOMPARE(identities.size(), 1); + }) + .exec().waitForFinished(); + + Store::remove(resource).exec().waitForFinished(); Store::fetchAll(Query()).then>([](const QList &resources) { -- cgit v1.2.3