From 5ddfe22ebf43763bdf49e639ca9a403e34e84c22 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 22 Aug 2017 11:06:17 -0600 Subject: Ensure the copied enum matches --- common/store.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common') diff --git a/common/store.cpp b/common/store.cpp index b0aac4c..1701a43 100644 --- a/common/store.cpp +++ b/common/store.cpp @@ -36,6 +36,17 @@ #include "storage.h" #include "log.h" +#define ASSERT_ENUMS_MATCH(A, B) Q_STATIC_ASSERT_X(static_cast(A) == static_cast(B), "The enum values must match"); + +//Ensure the copied enum matches +typedef ModelResult MailModelResult; +ASSERT_ENUMS_MATCH(Sink::Store::DomainObjectBaseRole, MailModelResult::DomainObjectBaseRole) +ASSERT_ENUMS_MATCH(Sink::Store::ChildrenFetchedRole, MailModelResult::ChildrenFetchedRole) +ASSERT_ENUMS_MATCH(Sink::Store::DomainObjectRole, MailModelResult::DomainObjectRole) +ASSERT_ENUMS_MATCH(Sink::Store::StatusRole, MailModelResult::StatusRole) +ASSERT_ENUMS_MATCH(Sink::Store::WarningRole, MailModelResult::WarningRole) +ASSERT_ENUMS_MATCH(Sink::Store::ProgressRole, MailModelResult::ProgressRole) + Q_DECLARE_METATYPE(QSharedPointer>) Q_DECLARE_METATYPE(QSharedPointer); Q_DECLARE_METATYPE(std::shared_ptr); -- cgit v1.2.3