diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-11 22:23:29 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-11 22:23:29 +0200 |
commit | 69d571248864ef0c4d810080aae2990fb2c27381 (patch) | |
tree | df67fdd824d5d021ae797347411e784bfd76897b /common/store.cpp | |
parent | fa319eea94e72e14685d1a9ba9704d55b0d027fb (diff) | |
download | sink-69d571248864ef0c4d810080aae2990fb2c27381.tar.gz sink-69d571248864ef0c4d810080aae2990fb2c27381.zip |
Centrally define global types
Diffstat (limited to 'common/store.cpp')
-rw-r--r-- | common/store.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/common/store.cpp b/common/store.cpp index a58287b..d7b277d 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -65,7 +65,7 @@ static QMap<QByteArray, QByteArray> getResources(const QList<QByteArray> &resour | |||
65 | 65 | ||
66 | QMap<QByteArray, QByteArray> resources; | 66 | QMap<QByteArray, QByteArray> resources; |
67 | // Return the global resource (signified by an empty name) for types that don't belong to a specific resource | 67 | // Return the global resource (signified by an empty name) for types that don't belong to a specific resource |
68 | if (type == "sinkresource" || type == "sinkaccount" || type == "identity") { | 68 | if (ApplicationDomain::isGlobalType(type)) { |
69 | resources.insert("", ""); | 69 | resources.insert("", ""); |
70 | return resources; | 70 | return resources; |
71 | } | 71 | } |
@@ -145,9 +145,7 @@ QSharedPointer<QAbstractItemModel> Store::loadModel(Query query) | |||
145 | template <class DomainType> | 145 | template <class DomainType> |
146 | static std::shared_ptr<StoreFacade<DomainType>> getFacade(const QByteArray &resourceInstanceIdentifier) | 146 | static std::shared_ptr<StoreFacade<DomainType>> getFacade(const QByteArray &resourceInstanceIdentifier) |
147 | { | 147 | { |
148 | 148 | if (ApplicationDomain::isGlobalType(ApplicationDomain::getTypeName<DomainType>())) { | |
149 | const auto type = ApplicationDomain::getTypeName<DomainType>(); | ||
150 | if (type == "sinkresource" || type == "sinkaccount") { | ||
151 | if (auto facade = FacadeFactory::instance().getFacade<DomainType>("", "")) { | 149 | if (auto facade = FacadeFactory::instance().getFacade<DomainType>("", "")) { |
152 | return facade; | 150 | return facade; |
153 | } | 151 | } |