From d488457bf699752b39b270cc88535d44f452b594 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 4 Oct 2016 14:57:40 +0200 Subject: Less hardcoding of entity types --- common/domain/applicationdomaintype.cpp | 15 +++++++++++++++ common/domain/applicationdomaintype.h | 2 ++ 2 files changed, 17 insertions(+) (limited to 'common') diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 5474708..f6db626 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp @@ -330,6 +330,21 @@ QByteArray getTypeName() return "folder"; } +QByteArrayList getTypeNames() +{ + static QByteArrayList types; + if (types.isEmpty()) { + types << ApplicationDomain::getTypeName(); + types << ApplicationDomain::getTypeName(); + types << ApplicationDomain::getTypeName(); + types << ApplicationDomain::getTypeName(); + types << ApplicationDomain::getTypeName(); + types << ApplicationDomain::getTypeName(); + types << ApplicationDomain::getTypeName(); + } + return types; +} + bool isGlobalType(const QByteArray &type) { if (type == ApplicationDomain::getTypeName() || type == ApplicationDomain::getTypeName() || type == ApplicationDomain::getTypeName()) { return true; diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index af2920c..2c8b2ee 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -366,6 +366,8 @@ QByteArray SINK_EXPORT getTypeName(); template<> QByteArray SINK_EXPORT getTypeName(); +QByteArrayList SINK_EXPORT getTypeNames(); + bool SINK_EXPORT isGlobalType(const QByteArray &type); -- cgit v1.2.3