summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/domain/applicationdomaintype.h3
-rw-r--r--common/store.cpp2
-rw-r--r--tests/accountstest.cpp12
3 files changed, 16 insertions, 1 deletions
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
@@ -194,6 +194,9 @@ template<>
194QByteArray SINK_EXPORT getTypeName<SinkAccount>(); 194QByteArray SINK_EXPORT getTypeName<SinkAccount>();
195 195
196template<> 196template<>
197QByteArray SINK_EXPORT getTypeName<Identity>();
198
199template<>
197QByteArray SINK_EXPORT getTypeName<Mail>(); 200QByteArray SINK_EXPORT getTypeName<Mail>();
198 201
199template<> 202template<>
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()
54static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type = QByteArray()) 54static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type = QByteArray())
55{ 55{
56 // Return the global resource (signified by an empty name) for types that don't belong to a specific resource 56 // Return the global resource (signified by an empty name) for types that don't belong to a specific resource
57 if (type == "sinkresource" || type == "sinkaccount") { 57 if (type == "sinkresource" || type == "sinkaccount" || type == "identity") {
58 return QList<QByteArray>() << ""; 58 return QList<QByteArray>() << "";
59 } 59 }
60 QList<QByteArray> resources; 60 QList<QByteArray> 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:
68 }) 68 })
69 .exec().waitForFinished(); 69 .exec().waitForFinished();
70 70
71 auto identity = ApplicationDomainType::createEntity<Identity>();
72 identity.setProperty("name", smtpServer);
73 identity.setProperty("address", smtpUsername);
74 identity.setProperty("account", account.identifier());
75 Store::create(identity).exec().waitForFinished();
76
77 Store::fetchAll<Identity>(Query()).then<void, QList<Identity::Ptr>>([&](const QList<Identity::Ptr> &identities) {
78 QCOMPARE(identities.size(), 1);
79 })
80 .exec().waitForFinished();
81
82
71 Store::remove(resource).exec().waitForFinished(); 83 Store::remove(resource).exec().waitForFinished();
72 84
73 Store::fetchAll<SinkResource>(Query()).then<void, QList<SinkResource>>([](const QList<SinkResource> &resources) { 85 Store::fetchAll<SinkResource>(Query()).then<void, QList<SinkResource>>([](const QList<SinkResource> &resources) {