From a188fb648ba001314adbb9d5cfc0bfb77198a5b9 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 21 Nov 2016 10:10:15 +0100 Subject: sinksh list identity support --- common/domain/applicationdomaintype.h | 2 ++ common/store.cpp | 3 +++ sinksh/sinksh_utils.cpp | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index d2b4d83..4621316 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -319,6 +319,8 @@ struct SINK_EXPORT Identity : public ApplicationDomainType { Identity(); virtual ~Identity(); SINK_REFERENCE_PROPERTY(SinkAccount, Account, account); + SINK_PROPERTY(QString, Name, name); + SINK_PROPERTY(QString, Address, address); }; struct SINK_EXPORT DummyResource { diff --git a/common/store.cpp b/common/store.cpp index 41b4867..5e0c327 100644 --- a/common/store.cpp +++ b/common/store.cpp @@ -200,6 +200,7 @@ static std::shared_ptr> getFacade(const QByteArray &reso template KAsync::Job Store::create(const DomainType &domainObject) { + SinkTrace() << "Create: " << domainObject; // Potentially move to separate thread as well auto facade = getFacade(domainObject.resourceInstanceIdentifier()); return facade->create(domainObject).addToContext(std::shared_ptr(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to create"; }); @@ -208,6 +209,7 @@ KAsync::Job Store::create(const DomainType &domainObject) template KAsync::Job Store::modify(const DomainType &domainObject) { + SinkTrace() << "Modify: " << domainObject; // Potentially move to separate thread as well auto facade = getFacade(domainObject.resourceInstanceIdentifier()); return facade->modify(domainObject).addToContext(std::shared_ptr(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to modify"; }); @@ -216,6 +218,7 @@ KAsync::Job Store::modify(const DomainType &domainObject) template KAsync::Job Store::remove(const DomainType &domainObject) { + SinkTrace() << "Remove: " << domainObject; // Potentially move to separate thread as well auto facade = getFacade(domainObject.resourceInstanceIdentifier()); return facade->remove(domainObject).addToContext(std::shared_ptr(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to remove"; }); diff --git a/sinksh/sinksh_utils.cpp b/sinksh/sinksh_utils.cpp index cb53ff2..06bcb8e 100644 --- a/sinksh/sinksh_utils.cpp +++ b/sinksh/sinksh_utils.cpp @@ -51,6 +51,9 @@ StoreBase &getStore(const QString &type) } else if (type == getTypeName()) { static Store store; return store; + } else if (type == getTypeName()) { + static Store store; + return store; } qWarning() << "Trying to get a store that doesn't exist, falling back to event"; @@ -75,6 +78,8 @@ QList requestedProperties(const QString &type) return QList() << SinkResource::ResourceType::name << SinkResource::Account::name; } else if (type == getTypeName()) { return QList() << SinkAccount::AccountType::name << SinkAccount::Name::name; + } else if (type == getTypeName()) { + return QList() << Identity::Name::name << Identity::Address::name; } return QList(); } -- cgit v1.2.3