From ae4b64b198a143240aa5dd1e202e5016abfdae71 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 8 Dec 2016 13:18:19 +0100 Subject: Wrap references in a Reerence type. This allows us to make sure that references are not taken out of context (the resource). Because we need to use the type-specific accessors more we also ran into a problem that we cannot "downcast" a reference with the change recording still working, for that we have the cast() operator now. --- examples/imapresource/imapresource.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/imapresource/imapresource.cpp') diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 9577f3e..238fb0c 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp @@ -92,17 +92,17 @@ public: const auto remoteId = folderPath.toUtf8(); const auto bufferType = ENTITY_TYPE_FOLDER; Sink::ApplicationDomain::Folder folder; - folder.setProperty(ApplicationDomain::Folder::Name::name, folderName); - folder.setProperty(ApplicationDomain::Folder::Icon::name, icon); + folder.setName(folderName); + folder.setIcon(icon); QHash mergeCriteria; if (SpecialPurpose::isSpecialPurposeFolderName(folderName)) { auto type = SpecialPurpose::getSpecialPurposeType(folderName); - folder.setProperty(ApplicationDomain::Folder::SpecialPurpose::name, QVariant::fromValue(QByteArrayList() << type)); + folder.setSpecialPurpose(QByteArrayList() << type); mergeCriteria.insert(ApplicationDomain::Folder::SpecialPurpose::name, Query::Comparator(type, Query::Comparator::Contains)); } if (!parentFolderRid.isEmpty()) { - folder.setProperty("parent", syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, parentFolderRid.toUtf8())); + folder.setParent(syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, parentFolderRid.toUtf8())); } createOrModify(bufferType, remoteId, folder, mergeCriteria); return remoteId; -- cgit v1.2.3