diff options
Diffstat (limited to 'common/store.cpp')
-rw-r--r-- | common/store.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/store.cpp b/common/store.cpp index f91973d..fad8c5e 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -216,6 +216,15 @@ KAsync::Job<void> Store::modify(const DomainType &domainObject) | |||
216 | } | 216 | } |
217 | 217 | ||
218 | template <class DomainType> | 218 | template <class DomainType> |
219 | KAsync::Job<void> Store::move(const DomainType &domainObject, const QByteArray &newResource) | ||
220 | { | ||
221 | SinkTrace() << "Move: " << domainObject << newResource; | ||
222 | // Potentially move to separate thread as well | ||
223 | auto facade = getFacade<DomainType>(domainObject.resourceInstanceIdentifier()); | ||
224 | return facade->move(domainObject, newResource).addToContext(std::shared_ptr<void>(facade)).onError([](const KAsync::Error &error) { SinkWarning() << "Failed to move"; }); | ||
225 | } | ||
226 | |||
227 | template <class DomainType> | ||
219 | KAsync::Job<void> Store::remove(const DomainType &domainObject) | 228 | KAsync::Job<void> Store::remove(const DomainType &domainObject) |
220 | { | 229 | { |
221 | SinkTrace() << "Remove: " << domainObject; | 230 | SinkTrace() << "Remove: " << domainObject; |
@@ -386,6 +395,7 @@ QList<DomainType> Store::read(const Sink::Query &q) | |||
386 | template KAsync::Job<void> Store::remove<T>(const T &domainObject); \ | 395 | template KAsync::Job<void> Store::remove<T>(const T &domainObject); \ |
387 | template KAsync::Job<void> Store::create<T>(const T &domainObject); \ | 396 | template KAsync::Job<void> Store::create<T>(const T &domainObject); \ |
388 | template KAsync::Job<void> Store::modify<T>(const T &domainObject); \ | 397 | template KAsync::Job<void> Store::modify<T>(const T &domainObject); \ |
398 | template KAsync::Job<void> Store::move<T>(const T &domainObject, const QByteArray &newResource); \ | ||
389 | template QSharedPointer<QAbstractItemModel> Store::loadModel<T>(Query query); \ | 399 | template QSharedPointer<QAbstractItemModel> Store::loadModel<T>(Query query); \ |
390 | template KAsync::Job<T> Store::fetchOne<T>(const Query &); \ | 400 | template KAsync::Job<T> Store::fetchOne<T>(const Query &); \ |
391 | template KAsync::Job<QList<T::Ptr>> Store::fetchAll<T>(const Query &); \ | 401 | template KAsync::Job<QList<T::Ptr>> Store::fetchAll<T>(const Query &); \ |