diff options
Diffstat (limited to 'examples/maildirresource/maildirresource.cpp')
-rw-r--r-- | examples/maildirresource/maildirresource.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index 9280bdc..33883a7 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp | |||
@@ -46,15 +46,15 @@ | |||
46 | #define ENTITY_TYPE_MAIL "mail" | 46 | #define ENTITY_TYPE_MAIL "mail" |
47 | #define ENTITY_TYPE_FOLDER "folder" | 47 | #define ENTITY_TYPE_FOLDER "folder" |
48 | 48 | ||
49 | MaildirResource::MaildirResource(const QByteArray &instanceIdentifier, const QSharedPointer<Akonadi2::Pipeline> &pipeline) | 49 | MaildirResource::MaildirResource(const QByteArray &instanceIdentifier, const QSharedPointer<Sink::Pipeline> &pipeline) |
50 | : Akonadi2::GenericResource(instanceIdentifier, pipeline), | 50 | : Sink::GenericResource(instanceIdentifier, pipeline), |
51 | mMailAdaptorFactory(QSharedPointer<MaildirMailAdaptorFactory>::create()), | 51 | mMailAdaptorFactory(QSharedPointer<MaildirMailAdaptorFactory>::create()), |
52 | mFolderAdaptorFactory(QSharedPointer<MaildirFolderAdaptorFactory>::create()) | 52 | mFolderAdaptorFactory(QSharedPointer<MaildirFolderAdaptorFactory>::create()) |
53 | { | 53 | { |
54 | addType(ENTITY_TYPE_MAIL, mMailAdaptorFactory, | 54 | addType(ENTITY_TYPE_MAIL, mMailAdaptorFactory, |
55 | QVector<Akonadi2::Preprocessor*>() << new DefaultIndexUpdater<Akonadi2::ApplicationDomain::Mail>); | 55 | QVector<Sink::Preprocessor*>() << new DefaultIndexUpdater<Sink::ApplicationDomain::Mail>); |
56 | addType(ENTITY_TYPE_FOLDER, mFolderAdaptorFactory, | 56 | addType(ENTITY_TYPE_FOLDER, mFolderAdaptorFactory, |
57 | QVector<Akonadi2::Preprocessor*>() << new DefaultIndexUpdater<Akonadi2::ApplicationDomain::Folder>); | 57 | QVector<Sink::Preprocessor*>() << new DefaultIndexUpdater<Sink::ApplicationDomain::Folder>); |
58 | auto config = ResourceConfig::getConfiguration(instanceIdentifier); | 58 | auto config = ResourceConfig::getConfiguration(instanceIdentifier); |
59 | mMaildirPath = QDir::cleanPath(QDir::fromNativeSeparators(config.value("path").toString())); | 59 | mMaildirPath = QDir::cleanPath(QDir::fromNativeSeparators(config.value("path").toString())); |
60 | //Chop a trailing slash if necessary | 60 | //Chop a trailing slash if necessary |
@@ -91,7 +91,7 @@ QStringList MaildirResource::listAvailableFolders() | |||
91 | return folderList; | 91 | return folderList; |
92 | } | 92 | } |
93 | 93 | ||
94 | void MaildirResource::synchronizeFolders(Akonadi2::Storage::Transaction &transaction, Akonadi2::Storage::Transaction &synchronizationTransaction) | 94 | void MaildirResource::synchronizeFolders(Sink::Storage::Transaction &transaction, Sink::Storage::Transaction &synchronizationTransaction) |
95 | { | 95 | { |
96 | const QByteArray bufferType = ENTITY_TYPE_FOLDER; | 96 | const QByteArray bufferType = ENTITY_TYPE_FOLDER; |
97 | QStringList folderList = listAvailableFolders(); | 97 | QStringList folderList = listAvailableFolders(); |
@@ -102,7 +102,7 @@ void MaildirResource::synchronizeFolders(Akonadi2::Storage::Transaction &transac | |||
102 | //TODO Instead of iterating over all entries in the database, which can also pick up the same item multiple times, | 102 | //TODO Instead of iterating over all entries in the database, which can also pick up the same item multiple times, |
103 | //we should rather iterate over an index that contains every uid exactly once. The remoteId index would be such an index, | 103 | //we should rather iterate over an index that contains every uid exactly once. The remoteId index would be such an index, |
104 | //but we currently fail to iterate over all entries in an index it seems. | 104 | //but we currently fail to iterate over all entries in an index it seems. |
105 | // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function<void(const Akonadi2::Storage::Error &)>(), true); | 105 | // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function<void(const Sink::Storage::Error &)>(), true); |
106 | auto mainDatabase = transaction.openDatabase(bufferType + ".main"); | 106 | auto mainDatabase = transaction.openDatabase(bufferType + ".main"); |
107 | mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { | 107 | mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { |
108 | callback(key); | 108 | callback(key); |
@@ -119,7 +119,7 @@ void MaildirResource::synchronizeFolders(Akonadi2::Storage::Transaction &transac | |||
119 | Trace() << "Processing folder " << remoteId; | 119 | Trace() << "Processing folder " << remoteId; |
120 | KPIM::Maildir md(folderPath, folderPath == mMaildirPath); | 120 | KPIM::Maildir md(folderPath, folderPath == mMaildirPath); |
121 | 121 | ||
122 | Akonadi2::ApplicationDomain::Folder folder; | 122 | Sink::ApplicationDomain::Folder folder; |
123 | folder.setProperty("name", md.name()); | 123 | folder.setProperty("name", md.name()); |
124 | folder.setProperty("icon", "folder"); | 124 | folder.setProperty("icon", "folder"); |
125 | if (!md.isRoot()) { | 125 | if (!md.isRoot()) { |
@@ -129,7 +129,7 @@ void MaildirResource::synchronizeFolders(Akonadi2::Storage::Transaction &transac | |||
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 | ||
132 | void MaildirResource::synchronizeMails(Akonadi2::Storage::Transaction &transaction, Akonadi2::Storage::Transaction &synchronizationTransaction, const QString &path) | 132 | void MaildirResource::synchronizeMails(Sink::Storage::Transaction &transaction, Sink::Storage::Transaction &synchronizationTransaction, const QString &path) |
133 | { | 133 | { |
134 | Trace() << "Synchronizing mails" << path; | 134 | Trace() << "Synchronizing mails" << path; |
135 | const QByteArray bufferType = ENTITY_TYPE_MAIL; | 135 | const QByteArray bufferType = ENTITY_TYPE_MAIL; |
@@ -150,8 +150,8 @@ void MaildirResource::synchronizeMails(Akonadi2::Storage::Transaction &transacti | |||
150 | scanForRemovals(transaction, synchronizationTransaction, bufferType, | 150 | scanForRemovals(transaction, synchronizationTransaction, bufferType, |
151 | [&](const std::function<void(const QByteArray &)> &callback) { | 151 | [&](const std::function<void(const QByteArray &)> &callback) { |
152 | Index index(bufferType + ".index." + property, transaction); | 152 | Index index(bufferType + ".index." + property, transaction); |
153 | index.lookup(folderLocalId, [&](const QByteArray &akonadiId) { | 153 | index.lookup(folderLocalId, [&](const QByteArray &sinkId) { |
154 | callback(akonadiId); | 154 | callback(sinkId); |
155 | }, | 155 | }, |
156 | [&](const Index::Error &error) { | 156 | [&](const Index::Error &error) { |
157 | Warning() << "Error in index: " << error.message << property; | 157 | Warning() << "Error in index: " << error.message << property; |
@@ -175,7 +175,7 @@ void MaildirResource::synchronizeMails(Akonadi2::Storage::Transaction &transacti | |||
175 | 175 | ||
176 | Trace() << "Found a mail " << filePath << " : " << fileName << msg->subject(true)->asUnicodeString(); | 176 | Trace() << "Found a mail " << filePath << " : " << fileName << msg->subject(true)->asUnicodeString(); |
177 | 177 | ||
178 | Akonadi2::ApplicationDomain::Mail mail; | 178 | Sink::ApplicationDomain::Mail mail; |
179 | mail.setProperty("subject", msg->subject(true)->asUnicodeString()); | 179 | mail.setProperty("subject", msg->subject(true)->asUnicodeString()); |
180 | mail.setProperty("sender", msg->from(true)->asUnicodeString()); | 180 | mail.setProperty("sender", msg->from(true)->asUnicodeString()); |
181 | mail.setProperty("senderName", msg->from(true)->asUnicodeString()); | 181 | mail.setProperty("senderName", msg->from(true)->asUnicodeString()); |
@@ -189,19 +189,19 @@ void MaildirResource::synchronizeMails(Akonadi2::Storage::Transaction &transacti | |||
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | KAsync::Job<void> MaildirResource::synchronizeWithSource(Akonadi2::Storage &mainStore, Akonadi2::Storage &synchronizationStore) | 192 | KAsync::Job<void> MaildirResource::synchronizeWithSource(Sink::Storage &mainStore, Sink::Storage &synchronizationStore) |
193 | { | 193 | { |
194 | Log() << " Synchronizing"; | 194 | Log() << " Synchronizing"; |
195 | return KAsync::start<void>([this, &mainStore, &synchronizationStore]() { | 195 | return KAsync::start<void>([this, &mainStore, &synchronizationStore]() { |
196 | auto transaction = mainStore.createTransaction(Akonadi2::Storage::ReadOnly); | 196 | auto transaction = mainStore.createTransaction(Sink::Storage::ReadOnly); |
197 | { | 197 | { |
198 | auto synchronizationTransaction = synchronizationStore.createTransaction(Akonadi2::Storage::ReadWrite); | 198 | auto synchronizationTransaction = synchronizationStore.createTransaction(Sink::Storage::ReadWrite); |
199 | synchronizeFolders(transaction, synchronizationTransaction); | 199 | synchronizeFolders(transaction, synchronizationTransaction); |
200 | //The next sync needs the folders available | 200 | //The next sync needs the folders available |
201 | synchronizationTransaction.commit(); | 201 | synchronizationTransaction.commit(); |
202 | } | 202 | } |
203 | for (const auto &folder : listAvailableFolders()) { | 203 | for (const auto &folder : listAvailableFolders()) { |
204 | auto synchronizationTransaction = synchronizationStore.createTransaction(Akonadi2::Storage::ReadWrite); | 204 | auto synchronizationTransaction = synchronizationStore.createTransaction(Sink::Storage::ReadWrite); |
205 | synchronizeMails(transaction, synchronizationTransaction, folder); | 205 | synchronizeMails(transaction, synchronizationTransaction, folder); |
206 | //Don't let the transaction grow too much | 206 | //Don't let the transaction grow too much |
207 | synchronizationTransaction.commit(); | 207 | synchronizationTransaction.commit(); |
@@ -210,23 +210,23 @@ KAsync::Job<void> MaildirResource::synchronizeWithSource(Akonadi2::Storage &main | |||
210 | }); | 210 | }); |
211 | } | 211 | } |
212 | 212 | ||
213 | KAsync::Job<void> MaildirResource::replay(Akonadi2::Storage &synchronizationStore, const QByteArray &type, const QByteArray &key, const QByteArray &value) | 213 | KAsync::Job<void> MaildirResource::replay(Sink::Storage &synchronizationStore, const QByteArray &type, const QByteArray &key, const QByteArray &value) |
214 | { | 214 | { |
215 | auto synchronizationTransaction = synchronizationStore.createTransaction(Akonadi2::Storage::ReadWrite); | 215 | auto synchronizationTransaction = synchronizationStore.createTransaction(Sink::Storage::ReadWrite); |
216 | 216 | ||
217 | Trace() << "Replaying " << key << type; | 217 | Trace() << "Replaying " << key << type; |
218 | if (type == ENTITY_TYPE_FOLDER) { | 218 | if (type == ENTITY_TYPE_FOLDER) { |
219 | Akonadi2::EntityBuffer buffer(value.data(), value.size()); | 219 | Sink::EntityBuffer buffer(value.data(), value.size()); |
220 | const Akonadi2::Entity &entity = buffer.entity(); | 220 | const Sink::Entity &entity = buffer.entity(); |
221 | const auto metadataBuffer = Akonadi2::EntityBuffer::readBuffer<Akonadi2::Metadata>(entity.metadata()); | 221 | const auto metadataBuffer = Sink::EntityBuffer::readBuffer<Sink::Metadata>(entity.metadata()); |
222 | if (metadataBuffer && !metadataBuffer->replayToSource()) { | 222 | if (metadataBuffer && !metadataBuffer->replayToSource()) { |
223 | Trace() << "Change is coming from the source"; | 223 | Trace() << "Change is coming from the source"; |
224 | return KAsync::null<void>(); | 224 | return KAsync::null<void>(); |
225 | } | 225 | } |
226 | const qint64 revision = metadataBuffer ? metadataBuffer->revision() : -1; | 226 | const qint64 revision = metadataBuffer ? metadataBuffer->revision() : -1; |
227 | const auto operation = metadataBuffer ? metadataBuffer->operation() : Akonadi2::Operation_Creation; | 227 | const auto operation = metadataBuffer ? metadataBuffer->operation() : Sink::Operation_Creation; |
228 | if (operation == Akonadi2::Operation_Creation) { | 228 | if (operation == Sink::Operation_Creation) { |
229 | const Akonadi2::ApplicationDomain::Folder folder(mResourceInstanceIdentifier, Akonadi2::Storage::uidFromKey(key), revision, mFolderAdaptorFactory->createAdaptor(entity)); | 229 | const Sink::ApplicationDomain::Folder folder(mResourceInstanceIdentifier, Sink::Storage::uidFromKey(key), revision, mFolderAdaptorFactory->createAdaptor(entity)); |
230 | auto folderName = folder.getProperty("name").toString(); | 230 | auto folderName = folder.getProperty("name").toString(); |
231 | //TODO handle non toplevel folders | 231 | //TODO handle non toplevel folders |
232 | auto path = mMaildirPath + "/" + folderName; | 232 | auto path = mMaildirPath + "/" + folderName; |
@@ -234,31 +234,31 @@ KAsync::Job<void> MaildirResource::replay(Akonadi2::Storage &synchronizationStor | |||
234 | KPIM::Maildir maildir(path, false); | 234 | KPIM::Maildir maildir(path, false); |
235 | maildir.create(); | 235 | maildir.create(); |
236 | recordRemoteId(ENTITY_TYPE_FOLDER, folder.identifier(), path.toUtf8(), synchronizationTransaction); | 236 | recordRemoteId(ENTITY_TYPE_FOLDER, folder.identifier(), path.toUtf8(), synchronizationTransaction); |
237 | } else if (operation == Akonadi2::Operation_Removal) { | 237 | } else if (operation == Sink::Operation_Removal) { |
238 | const auto uid = Akonadi2::Storage::uidFromKey(key); | 238 | const auto uid = Sink::Storage::uidFromKey(key); |
239 | const auto remoteId = resolveLocalId(ENTITY_TYPE_FOLDER, uid, synchronizationTransaction); | 239 | const auto remoteId = resolveLocalId(ENTITY_TYPE_FOLDER, uid, synchronizationTransaction); |
240 | const auto path = remoteId; | 240 | const auto path = remoteId; |
241 | Trace() << "Removing a folder: " << path; | 241 | Trace() << "Removing a folder: " << path; |
242 | KPIM::Maildir maildir(path, false); | 242 | KPIM::Maildir maildir(path, false); |
243 | maildir.remove(); | 243 | maildir.remove(); |
244 | removeRemoteId(ENTITY_TYPE_FOLDER, uid, remoteId, synchronizationTransaction); | 244 | removeRemoteId(ENTITY_TYPE_FOLDER, uid, remoteId, synchronizationTransaction); |
245 | } else if (operation == Akonadi2::Operation_Modification) { | 245 | } else if (operation == Sink::Operation_Modification) { |
246 | Warning() << "Folder modifications are not implemented"; | 246 | Warning() << "Folder modifications are not implemented"; |
247 | } else { | 247 | } else { |
248 | Warning() << "Unkown operation" << operation; | 248 | Warning() << "Unkown operation" << operation; |
249 | } | 249 | } |
250 | } else if (type == ENTITY_TYPE_MAIL) { | 250 | } else if (type == ENTITY_TYPE_MAIL) { |
251 | Akonadi2::EntityBuffer buffer(value.data(), value.size()); | 251 | Sink::EntityBuffer buffer(value.data(), value.size()); |
252 | const Akonadi2::Entity &entity = buffer.entity(); | 252 | const Sink::Entity &entity = buffer.entity(); |
253 | const auto metadataBuffer = Akonadi2::EntityBuffer::readBuffer<Akonadi2::Metadata>(entity.metadata()); | 253 | const auto metadataBuffer = Sink::EntityBuffer::readBuffer<Sink::Metadata>(entity.metadata()); |
254 | if (metadataBuffer && !metadataBuffer->replayToSource()) { | 254 | if (metadataBuffer && !metadataBuffer->replayToSource()) { |
255 | Trace() << "Change is coming from the source"; | 255 | Trace() << "Change is coming from the source"; |
256 | return KAsync::null<void>(); | 256 | return KAsync::null<void>(); |
257 | } | 257 | } |
258 | const qint64 revision = metadataBuffer ? metadataBuffer->revision() : -1; | 258 | const qint64 revision = metadataBuffer ? metadataBuffer->revision() : -1; |
259 | const auto operation = metadataBuffer ? metadataBuffer->operation() : Akonadi2::Operation_Creation; | 259 | const auto operation = metadataBuffer ? metadataBuffer->operation() : Sink::Operation_Creation; |
260 | if (operation == Akonadi2::Operation_Creation) { | 260 | if (operation == Sink::Operation_Creation) { |
261 | const Akonadi2::ApplicationDomain::Mail mail(mResourceInstanceIdentifier, Akonadi2::Storage::uidFromKey(key), revision, mMailAdaptorFactory->createAdaptor(entity)); | 261 | const Sink::ApplicationDomain::Mail mail(mResourceInstanceIdentifier, Sink::Storage::uidFromKey(key), revision, mMailAdaptorFactory->createAdaptor(entity)); |
262 | auto parentFolder = mail.getProperty("folder").toByteArray(); | 262 | auto parentFolder = mail.getProperty("folder").toByteArray(); |
263 | QByteArray parentFolderRemoteId; | 263 | QByteArray parentFolderRemoteId; |
264 | if (!parentFolder.isEmpty()) { | 264 | if (!parentFolder.isEmpty()) { |
@@ -272,13 +272,13 @@ KAsync::Job<void> MaildirResource::replay(Akonadi2::Storage &synchronizationStor | |||
272 | const auto id = maildir.addEntry("foobar"); | 272 | const auto id = maildir.addEntry("foobar"); |
273 | Trace() << "Creating a new mail: " << id; | 273 | Trace() << "Creating a new mail: " << id; |
274 | recordRemoteId(ENTITY_TYPE_MAIL, mail.identifier(), id.toUtf8(), synchronizationTransaction); | 274 | recordRemoteId(ENTITY_TYPE_MAIL, mail.identifier(), id.toUtf8(), synchronizationTransaction); |
275 | } else if (operation == Akonadi2::Operation_Removal) { | 275 | } else if (operation == Sink::Operation_Removal) { |
276 | const auto uid = Akonadi2::Storage::uidFromKey(key); | 276 | const auto uid = Sink::Storage::uidFromKey(key); |
277 | const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, uid, synchronizationTransaction); | 277 | const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, uid, synchronizationTransaction); |
278 | Trace() << "Removing a mail: " << remoteId; | 278 | Trace() << "Removing a mail: " << remoteId; |
279 | QFile::remove(remoteId); | 279 | QFile::remove(remoteId); |
280 | removeRemoteId(ENTITY_TYPE_MAIL, uid, remoteId, synchronizationTransaction); | 280 | removeRemoteId(ENTITY_TYPE_MAIL, uid, remoteId, synchronizationTransaction); |
281 | } else if (operation == Akonadi2::Operation_Modification) { | 281 | } else if (operation == Sink::Operation_Modification) { |
282 | Warning() << "Mail modifications are not implemented"; | 282 | Warning() << "Mail modifications are not implemented"; |
283 | } else { | 283 | } else { |
284 | Warning() << "Unkown operation" << operation; | 284 | Warning() << "Unkown operation" << operation; |
@@ -290,16 +290,16 @@ KAsync::Job<void> MaildirResource::replay(Akonadi2::Storage &synchronizationStor | |||
290 | void MaildirResource::removeFromDisk(const QByteArray &instanceIdentifier) | 290 | void MaildirResource::removeFromDisk(const QByteArray &instanceIdentifier) |
291 | { | 291 | { |
292 | GenericResource::removeFromDisk(instanceIdentifier); | 292 | GenericResource::removeFromDisk(instanceIdentifier); |
293 | Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".synchronization", Akonadi2::Storage::ReadWrite).removeFromDisk(); | 293 | Sink::Storage(Sink::storageLocation(), instanceIdentifier + ".synchronization", Sink::Storage::ReadWrite).removeFromDisk(); |
294 | } | 294 | } |
295 | 295 | ||
296 | KAsync::Job<void> MaildirResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) | 296 | KAsync::Job<void> MaildirResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) |
297 | { | 297 | { |
298 | auto synchronizationStore = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::storageLocation(), mResourceInstanceIdentifier + ".synchronization", Akonadi2::Storage::ReadOnly); | 298 | auto synchronizationStore = QSharedPointer<Sink::Storage>::create(Sink::storageLocation(), mResourceInstanceIdentifier + ".synchronization", Sink::Storage::ReadOnly); |
299 | auto synchronizationTransaction = synchronizationStore->createTransaction(Akonadi2::Storage::ReadOnly); | 299 | auto synchronizationTransaction = synchronizationStore->createTransaction(Sink::Storage::ReadOnly); |
300 | Trace() << "Inspecting " << inspectionType << domainType << entityId << property << expectedValue; | 300 | Trace() << "Inspecting " << inspectionType << domainType << entityId << property << expectedValue; |
301 | if (domainType == ENTITY_TYPE_MAIL) { | 301 | if (domainType == ENTITY_TYPE_MAIL) { |
302 | if (inspectionType == Akonadi2::Resources::Inspection::PropertyInspectionType) { | 302 | if (inspectionType == Sink::Resources::Inspection::PropertyInspectionType) { |
303 | if (property == "unread") { | 303 | if (property == "unread") { |
304 | const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction); | 304 | const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction); |
305 | const auto flags = KPIM::Maildir::readEntryFlags(remoteId.split('/').last()); | 305 | const auto flags = KPIM::Maildir::readEntryFlags(remoteId.split('/').last()); |
@@ -312,7 +312,7 @@ KAsync::Job<void> MaildirResource::inspect(int inspectionType, const QByteArray | |||
312 | return KAsync::null<void>(); | 312 | return KAsync::null<void>(); |
313 | } | 313 | } |
314 | } | 314 | } |
315 | if (inspectionType == Akonadi2::Resources::Inspection::ExistenceInspectionType) { | 315 | if (inspectionType == Sink::Resources::Inspection::ExistenceInspectionType) { |
316 | const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction); | 316 | const auto remoteId = resolveLocalId(ENTITY_TYPE_MAIL, entityId, synchronizationTransaction); |
317 | if (QFileInfo(remoteId).exists() != expectedValue.toBool()) { | 317 | if (QFileInfo(remoteId).exists() != expectedValue.toBool()) { |
318 | return KAsync::error<void>(1, "Wrong file existence: " + remoteId); | 318 | return KAsync::error<void>(1, "Wrong file existence: " + remoteId); |
@@ -323,19 +323,19 @@ KAsync::Job<void> MaildirResource::inspect(int inspectionType, const QByteArray | |||
323 | } | 323 | } |
324 | 324 | ||
325 | MaildirResourceFactory::MaildirResourceFactory(QObject *parent) | 325 | MaildirResourceFactory::MaildirResourceFactory(QObject *parent) |
326 | : Akonadi2::ResourceFactory(parent) | 326 | : Sink::ResourceFactory(parent) |
327 | { | 327 | { |
328 | 328 | ||
329 | } | 329 | } |
330 | 330 | ||
331 | Akonadi2::Resource *MaildirResourceFactory::createResource(const QByteArray &instanceIdentifier) | 331 | Sink::Resource *MaildirResourceFactory::createResource(const QByteArray &instanceIdentifier) |
332 | { | 332 | { |
333 | return new MaildirResource(instanceIdentifier); | 333 | return new MaildirResource(instanceIdentifier); |
334 | } | 334 | } |
335 | 335 | ||
336 | void MaildirResourceFactory::registerFacades(Akonadi2::FacadeFactory &factory) | 336 | void MaildirResourceFactory::registerFacades(Sink::FacadeFactory &factory) |
337 | { | 337 | { |
338 | factory.registerFacade<Akonadi2::ApplicationDomain::Mail, MaildirResourceMailFacade>(PLUGIN_NAME); | 338 | factory.registerFacade<Sink::ApplicationDomain::Mail, MaildirResourceMailFacade>(PLUGIN_NAME); |
339 | factory.registerFacade<Akonadi2::ApplicationDomain::Folder, MaildirResourceFolderFacade>(PLUGIN_NAME); | 339 | factory.registerFacade<Sink::ApplicationDomain::Folder, MaildirResourceFolderFacade>(PLUGIN_NAME); |
340 | } | 340 | } |
341 | 341 | ||