summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-17 20:54:29 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-17 20:54:29 +0100
commitb63e7145e91057ce042a868d62b50bb6507cb4b9 (patch)
treefc2918887c5c094c8667ae66ca9c0ed1ec3b0748
parentc3b3315f9273e80581aa6592ceaffd73617a0e41 (diff)
downloadsink-b63e7145e91057ce042a868d62b50bb6507cb4b9.tar.gz
sink-b63e7145e91057ce042a868d62b50bb6507cb4b9.zip
Fixed operations on accounts and resources
-rw-r--r--common/store.cpp10
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)
116template <class DomainType> 116template <class DomainType>
117static std::shared_ptr<StoreFacade<DomainType>> getFacade(const QByteArray &resourceInstanceIdentifier) 117static 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>>();