From ba7c8b890c45d735216888204ec88882ef58c918 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 19 Oct 2016 15:28:42 +0200 Subject: Ported the pipeline to the entitystore --- common/specialpurposepreprocessor.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'common/specialpurposepreprocessor.cpp') diff --git a/common/specialpurposepreprocessor.cpp b/common/specialpurposepreprocessor.cpp index 0fd8e34..920f78a 100644 --- a/common/specialpurposepreprocessor.cpp +++ b/common/specialpurposepreprocessor.cpp @@ -46,11 +46,11 @@ QByteArray getSpecialPurposeType(const QString &name) SpecialPurposeProcessor::SpecialPurposeProcessor(const QByteArray &resourceType, const QByteArray &resourceInstanceIdentifier) : mResourceType(resourceType), mResourceInstanceIdentifier(resourceInstanceIdentifier) {} -QByteArray SpecialPurposeProcessor::ensureFolder(Sink::Storage::DataStore::Transaction &transaction, const QByteArray &specialPurpose) +QByteArray SpecialPurposeProcessor::ensureFolder(const QByteArray &specialPurpose) { /* if (!mSpecialPurposeFolders.contains(specialPurpose)) { */ /* //Try to find an existing drafts folder */ - /* Sink::EntityReader reader(mResourceType, mResourceInstanceIdentifier, transaction); */ + /* Sink::EntityReader reader(mResourceType, mResourceInstanceIdentifier); */ /* reader.query(Sink::Query().filter(Query::Comparator(specialPurpose, Query::Comparator::Contains)), */ /* [this, specialPurpose](const ApplicationDomain::Folder &f) -> bool{ */ /* mSpecialPurposeFolders.insert(specialPurpose, f.identifier()); */ @@ -70,23 +70,23 @@ QByteArray SpecialPurposeProcessor::ensureFolder(Sink::Storage::DataStore::Trans return mSpecialPurposeFolders.value(specialPurpose); } -void SpecialPurposeProcessor::moveToFolder(Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::DataStore::Transaction &transaction) +void SpecialPurposeProcessor::moveToFolder(Sink::ApplicationDomain::ApplicationDomainType &newEntity) { if (newEntity.getProperty("trash").toBool()) { - newEntity.setProperty("folder", ensureFolder(transaction, "trash")); + newEntity.setProperty("folder", ensureFolder("trash")); return; } if (newEntity.getProperty("draft").toBool()) { - newEntity.setProperty("folder", ensureFolder(transaction, "drafts")); + newEntity.setProperty("folder", ensureFolder("drafts")); } } -void SpecialPurposeProcessor::newEntity(const QByteArray &uid, qint64 revision, Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::DataStore::Transaction &transaction) +void SpecialPurposeProcessor::newEntity(Sink::ApplicationDomain::ApplicationDomainType &newEntity) { - moveToFolder(newEntity, transaction); + moveToFolder(newEntity); } -void SpecialPurposeProcessor::modifiedEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::DataStore::Transaction &transaction) +void SpecialPurposeProcessor::modifiedEntity(const Sink::ApplicationDomain::ApplicationDomainType &oldEntity, Sink::ApplicationDomain::ApplicationDomainType &newEntity) { - moveToFolder(newEntity, transaction); + moveToFolder(newEntity); } -- cgit v1.2.3