summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/domain/applicationdomaintype.cpp15
-rw-r--r--common/domain/applicationdomaintype.h2
-rw-r--r--tests/accountstest.cpp3
3 files changed, 19 insertions, 1 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp
index 42ae11a..c59a01e 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -31,12 +31,13 @@ namespace ApplicationDomain {
31 31
32constexpr const char *Mail::ThreadId::name; 32constexpr const char *Mail::ThreadId::name;
33 33
34int foo = [] { 34static const int foo = [] {
35 QMetaType::registerEqualsComparator<Reference>(); 35 QMetaType::registerEqualsComparator<Reference>();
36 QMetaType::registerDebugStreamOperator<Reference>(); 36 QMetaType::registerDebugStreamOperator<Reference>();
37 QMetaType::registerConverter<Reference, QByteArray>(); 37 QMetaType::registerConverter<Reference, QByteArray>();
38 QMetaType::registerDebugStreamOperator<BLOB>(); 38 QMetaType::registerDebugStreamOperator<BLOB>();
39 QMetaType::registerDebugStreamOperator<Mail::Contact>(); 39 QMetaType::registerDebugStreamOperator<Mail::Contact>();
40 qRegisterMetaTypeStreamOperators<Sink::ApplicationDomain::Reference>();
40 return 0; 41 return 0;
41}(); 42}();
42 43
@@ -395,3 +396,15 @@ bool isGlobalType(const QByteArray &type) {
395} 396}
396} 397}
397 398
399QDataStream &operator<<(QDataStream &out, const Sink::ApplicationDomain::Reference &reference)
400{
401 out << reference.value;
402 return out;
403}
404
405QDataStream &operator>>(QDataStream &in, Sink::ApplicationDomain::Reference &reference)
406{
407 in >> reference.value;
408 return in;
409}
410
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h
index 1848224..b4d6f8a 100644
--- a/common/domain/applicationdomaintype.h
+++ b/common/domain/applicationdomaintype.h
@@ -502,6 +502,8 @@ class SINK_EXPORT TypeImplementation;
502 REGISTER_TYPE(Sink::ApplicationDomain::SinkAccount); \ 502 REGISTER_TYPE(Sink::ApplicationDomain::SinkAccount); \
503 REGISTER_TYPE(Sink::ApplicationDomain::Identity); \ 503 REGISTER_TYPE(Sink::ApplicationDomain::Identity); \
504 504
505QDataStream & SINK_EXPORT operator<<(QDataStream &out, const Sink::ApplicationDomain::Reference &reference);
506QDataStream & SINK_EXPORT operator>>(QDataStream &in, Sink::ApplicationDomain::Reference &reference);
505 507
506Q_DECLARE_METATYPE(Sink::ApplicationDomain::ApplicationDomainType) 508Q_DECLARE_METATYPE(Sink::ApplicationDomain::ApplicationDomainType)
507Q_DECLARE_METATYPE(Sink::ApplicationDomain::ApplicationDomainType::Ptr) 509Q_DECLARE_METATYPE(Sink::ApplicationDomain::ApplicationDomainType::Ptr)
diff --git a/tests/accountstest.cpp b/tests/accountstest.cpp
index 029b92f..cce5c7b 100644
--- a/tests/accountstest.cpp
+++ b/tests/accountstest.cpp
@@ -76,6 +76,9 @@ private slots:
76 76
77 Store::fetchAll<Identity>(Query()).syncThen<void, QList<Identity::Ptr>>([&](const QList<Identity::Ptr> &identities) { 77 Store::fetchAll<Identity>(Query()).syncThen<void, QList<Identity::Ptr>>([&](const QList<Identity::Ptr> &identities) {
78 QCOMPARE(identities.size(), 1); 78 QCOMPARE(identities.size(), 1);
79 QCOMPARE(identities.first()->getName(), smtpServer);
80 QCOMPARE(identities.first()->getAddress(), smtpUsername);
81 QCOMPARE(identities.first()->getAccount(), account.identifier());
79 }) 82 })
80 .exec().waitForFinished(); 83 .exec().waitForFinished();
81 84