diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-17 20:54:29 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-17 20:54:29 +0100 |
commit | b63e7145e91057ce042a868d62b50bb6507cb4b9 (patch) | |
tree | fc2918887c5c094c8667ae66ca9c0ed1ec3b0748 /common/store.cpp | |
parent | c3b3315f9273e80581aa6592ceaffd73617a0e41 (diff) | |
download | sink-b63e7145e91057ce042a868d62b50bb6507cb4b9.tar.gz sink-b63e7145e91057ce042a868d62b50bb6507cb4b9.zip |
Fixed operations on accounts and resources
Diffstat (limited to 'common/store.cpp')
-rw-r--r-- | common/store.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/common/store.cpp b/common/store.cpp index bedbc47..4bf1c58 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -116,7 +116,15 @@ QSharedPointer<QAbstractItemModel> Store::loadModel(Query query) | |||
116 | template <class DomainType> | 116 | template <class DomainType> |
117 | static std::shared_ptr<StoreFacade<DomainType>> getFacade(const QByteArray &resourceInstanceIdentifier) | 117 | static std::shared_ptr<StoreFacade<DomainType>> getFacade(const QByteArray &resourceInstanceIdentifier) |
118 | { | 118 | { |
119 | if (auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceName(resourceInstanceIdentifier), resourceInstanceIdentifier)) { | 119 | |
120 | const auto type = ApplicationDomain::getTypeName<DomainType>(); | ||
121 | if (type == "sinkresource" || type == "sinkaccount") { | ||
122 | if (auto facade = FacadeFactory::instance().getFacade<DomainType>("", "")) { | ||
123 | return facade; | ||
124 | } | ||
125 | } | ||
126 | const auto resourceType = resourceName(resourceInstanceIdentifier); | ||
127 | if (auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceType, resourceInstanceIdentifier)) { | ||
120 | return facade; | 128 | return facade; |
121 | } | 129 | } |
122 | return std::make_shared<NullFacade<DomainType>>(); | 130 | return std::make_shared<NullFacade<DomainType>>(); |