diff options
-rw-r--r-- | common/clientapi.cpp | 10 | ||||
-rw-r--r-- | common/modelresult.cpp | 1 | ||||
-rw-r--r-- | common/queryrunner.cpp | 2 | ||||
-rw-r--r-- | common/resultprovider.h | 1 | ||||
-rw-r--r-- | common/storage_lmdb.cpp | 1 | ||||
-rw-r--r-- | examples/maildirresource/maildirresource.cpp | 2 |
6 files changed, 14 insertions, 3 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp index 25f0f1f..ab2af7a 100644 --- a/common/clientapi.cpp +++ b/common/clientapi.cpp | |||
@@ -81,6 +81,11 @@ QList<QByteArray> Store::getResources(const QList<QByteArray> &resourceFilter, c | |||
81 | template <class DomainType> | 81 | template <class DomainType> |
82 | QSharedPointer<QAbstractItemModel> Store::loadModel(Query query) | 82 | QSharedPointer<QAbstractItemModel> Store::loadModel(Query query) |
83 | { | 83 | { |
84 | Trace() << "Requested: " << query.requestedProperties; | ||
85 | Trace() << "Filter: " << query.propertyFilter; | ||
86 | Trace() << "Parent: " << query.parentProperty; | ||
87 | Trace() << "Ids: " << query.ids; | ||
88 | Trace() << "IsLive: " << query.liveQuery; | ||
84 | auto model = QSharedPointer<ModelResult<DomainType, typename DomainType::Ptr> >::create(query, query.requestedProperties); | 89 | auto model = QSharedPointer<ModelResult<DomainType, typename DomainType::Ptr> >::create(query, query.requestedProperties); |
85 | 90 | ||
86 | //* Client defines lifetime of model | 91 | //* Client defines lifetime of model |
@@ -193,9 +198,10 @@ void Store::removeFromDisk(const QByteArray &identifier) | |||
193 | 198 | ||
194 | KAsync::Job<void> Store::synchronize(const Akonadi2::Query &query) | 199 | KAsync::Job<void> Store::synchronize(const Akonadi2::Query &query) |
195 | { | 200 | { |
196 | Trace() << "synchronize"; | 201 | Trace() << "synchronize" << query.resources; |
197 | return KAsync::iterate(query.resources) | 202 | return KAsync::iterate(query.resources) |
198 | .template each<void, QByteArray>([query](const QByteArray &resource, KAsync::Future<void> &future) { | 203 | .template each<void, QByteArray>([query](const QByteArray &resource, KAsync::Future<void> &future) { |
204 | Trace() << "Synchronizing " << resource; | ||
199 | auto resourceAccess = QSharedPointer<Akonadi2::ResourceAccess>::create(resource); | 205 | auto resourceAccess = QSharedPointer<Akonadi2::ResourceAccess>::create(resource); |
200 | resourceAccess->open(); | 206 | resourceAccess->open(); |
201 | resourceAccess->synchronizeResource(query.syncOnDemand, query.processAll).then<void>([&future, resourceAccess]() { | 207 | resourceAccess->synchronizeResource(query.syncOnDemand, query.processAll).then<void>([&future, resourceAccess]() { |
diff --git a/common/modelresult.cpp b/common/modelresult.cpp index 690a17e..22798d9 100644 --- a/common/modelresult.cpp +++ b/common/modelresult.cpp | |||
@@ -163,6 +163,7 @@ void ModelResult<T, Ptr>::add(const Ptr &value) | |||
163 | const auto id = parentId(value); | 163 | const auto id = parentId(value); |
164 | //Ignore updates we get before the initial fetch is done | 164 | //Ignore updates we get before the initial fetch is done |
165 | if (!mEntityChildrenFetched.contains(id)) { | 165 | if (!mEntityChildrenFetched.contains(id)) { |
166 | Trace() << "Too early" << id; | ||
166 | return; | 167 | return; |
167 | } | 168 | } |
168 | auto parent = createIndexFromId(id); | 169 | auto parent = createIndexFromId(id); |
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index 9f6d23f..b3c9f07 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp | |||
@@ -226,7 +226,7 @@ std::function<bool(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr | |||
226 | if (property.isValid()) { | 226 | if (property.isValid()) { |
227 | //TODO implement other comparison operators than equality | 227 | //TODO implement other comparison operators than equality |
228 | if (property != query.propertyFilter.value(filterProperty)) { | 228 | if (property != query.propertyFilter.value(filterProperty)) { |
229 | Trace() << "Filtering entity due to property mismatch: " << domainObject->getProperty(filterProperty); | 229 | Trace() << "Filtering entity due to property mismatch on filter: " << filterProperty << property << ":" << query.propertyFilter.value(filterProperty); |
230 | return false; | 230 | return false; |
231 | } | 231 | } |
232 | } else { | 232 | } else { |
diff --git a/common/resultprovider.h b/common/resultprovider.h index 08a7d53..2c373c3 100644 --- a/common/resultprovider.h +++ b/common/resultprovider.h | |||
@@ -363,6 +363,7 @@ public: | |||
363 | void fetch(const DomainType &parent) Q_DECL_OVERRIDE | 363 | void fetch(const DomainType &parent) Q_DECL_OVERRIDE |
364 | { | 364 | { |
365 | if (mEmitter.isEmpty()) { | 365 | if (mEmitter.isEmpty()) { |
366 | Trace() << "No child emitters, the result is complete"; | ||
366 | this->initialResultSetComplete(parent); | 367 | this->initialResultSetComplete(parent); |
367 | } else { | 368 | } else { |
368 | for (const auto &emitter : mEmitter) { | 369 | for (const auto &emitter : mEmitter) { |
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index e32618b..ef3363a 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -603,6 +603,7 @@ void Storage::removeFromDisk() const | |||
603 | const QString fullPath(d->storageRoot + '/' + d->name); | 603 | const QString fullPath(d->storageRoot + '/' + d->name); |
604 | QMutexLocker locker(&d->sMutex); | 604 | QMutexLocker locker(&d->sMutex); |
605 | QDir dir(fullPath); | 605 | QDir dir(fullPath); |
606 | std::cout << "Removing database from disk: " << fullPath.toStdString() << std::endl; | ||
606 | if (!dir.removeRecursively()) { | 607 | if (!dir.removeRecursively()) { |
607 | Error error(d->name.toLatin1(), ErrorCodes::GenericError, QString("Failed to remove directory %1 %2").arg(d->storageRoot).arg(d->name).toLatin1()); | 608 | Error error(d->name.toLatin1(), ErrorCodes::GenericError, QString("Failed to remove directory %1 %2").arg(d->storageRoot).arg(d->name).toLatin1()); |
608 | defaultErrorHandler()(error); | 609 | defaultErrorHandler()(error); |
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index a19756a..f888b5d 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp | |||
@@ -52,6 +52,7 @@ MaildirResource::MaildirResource(const QByteArray &instanceIdentifier, const QSh | |||
52 | QVector<Akonadi2::Preprocessor*>() << new DefaultIndexUpdater<Akonadi2::ApplicationDomain::Folder>); | 52 | QVector<Akonadi2::Preprocessor*>() << new DefaultIndexUpdater<Akonadi2::ApplicationDomain::Folder>); |
53 | auto config = ResourceConfig::getConfiguration(instanceIdentifier); | 53 | auto config = ResourceConfig::getConfiguration(instanceIdentifier); |
54 | mMaildirPath = config.value("path").toString(); | 54 | mMaildirPath = config.value("path").toString(); |
55 | Trace() << "Started maildir resource for maildir: " << mMaildirPath; | ||
55 | } | 56 | } |
56 | 57 | ||
57 | QString MaildirResource::resolveRemoteId(const QByteArray &bufferType, const QString &remoteId, Akonadi2::Storage::Transaction &transaction) | 58 | QString MaildirResource::resolveRemoteId(const QByteArray &bufferType, const QString &remoteId, Akonadi2::Storage::Transaction &transaction) |
@@ -103,6 +104,7 @@ void MaildirResource::synchronizeFolders(Akonadi2::Storage::Transaction &transac | |||
103 | auto synchronizationTransaction = store.createTransaction(Akonadi2::Storage::ReadWrite); | 104 | auto synchronizationTransaction = store.createTransaction(Akonadi2::Storage::ReadWrite); |
104 | for (const auto folder : folderList) { | 105 | for (const auto folder : folderList) { |
105 | const auto remoteId = folder.toUtf8(); | 106 | const auto remoteId = folder.toUtf8(); |
107 | Trace() << "Processing folder " << remoteId; | ||
106 | auto akonadiId = resolveRemoteId(bufferType.toUtf8(), remoteId, synchronizationTransaction); | 108 | auto akonadiId = resolveRemoteId(bufferType.toUtf8(), remoteId, synchronizationTransaction); |
107 | 109 | ||
108 | bool found = false; | 110 | bool found = false; |