diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-08 16:51:06 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-10 10:40:01 +0200 |
commit | c08ac164d20c56e4b2890ebc9f2acda2c5723b5c (patch) | |
tree | 88a7f41d6ccd266db049d9b7c3d16c8a41905d7a | |
parent | 615fc9df81555ce5a2b16747640beba43e109ef4 (diff) | |
download | sink-c08ac164d20c56e4b2890ebc9f2acda2c5723b5c.tar.gz sink-c08ac164d20c56e4b2890ebc9f2acda2c5723b5c.zip |
Cleanup
-rw-r--r-- | common/entitystorage.cpp | 2 | ||||
-rw-r--r-- | common/entitystorage.h | 2 | ||||
-rw-r--r-- | common/genericresource.h | 1 | ||||
-rw-r--r-- | common/resource.h | 1 | ||||
-rw-r--r-- | common/storage_common.cpp | 8 |
5 files changed, 6 insertions, 8 deletions
diff --git a/common/entitystorage.cpp b/common/entitystorage.cpp index c60135e..33b65d6 100644 --- a/common/entitystorage.cpp +++ b/common/entitystorage.cpp | |||
@@ -90,8 +90,6 @@ ResultSet EntityStorageBase::filteredSet(const ResultSet &resultSet, const std:: | |||
90 | //Read through the source values and return whatever matches the filter | 90 | //Read through the source values and return whatever matches the filter |
91 | std::function<bool(std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)>)> generator = [this, resultSetPtr, &transaction, filter, initialQuery](std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)> callback) -> bool { | 91 | std::function<bool(std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)>)> generator = [this, resultSetPtr, &transaction, filter, initialQuery](std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)> callback) -> bool { |
92 | while (resultSetPtr->next()) { | 92 | while (resultSetPtr->next()) { |
93 | //TODO. every read value is actually a revision that contains one of three operations. Reflect that so the result set can be updated appropriately. | ||
94 | //TODO while getting the initial set everything is adding | ||
95 | readEntity(transaction, resultSetPtr->id(), [this, filter, callback, initialQuery](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &domainObject, Akonadi2::Operation operation) { | 93 | readEntity(transaction, resultSetPtr->id(), [this, filter, callback, initialQuery](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &domainObject, Akonadi2::Operation operation) { |
96 | if (filter(domainObject)) { | 94 | if (filter(domainObject)) { |
97 | if (initialQuery) { | 95 | if (initialQuery) { |
diff --git a/common/entitystorage.h b/common/entitystorage.h index 68b9e46..78dbcda 100644 --- a/common/entitystorage.h +++ b/common/entitystorage.h | |||
@@ -109,8 +109,6 @@ public: | |||
109 | auto transaction = storage.createTransaction(Akonadi2::Storage::ReadOnly); | 109 | auto transaction = storage.createTransaction(Akonadi2::Storage::ReadOnly); |
110 | 110 | ||
111 | Log() << "Querying" << baseRevision; | 111 | Log() << "Querying" << baseRevision; |
112 | //TODO fallback in case the old revision is no longer available to clear + redo complete initial scan | ||
113 | // | ||
114 | auto resultSet = getResultSet(query, transaction, baseRevision); | 112 | auto resultSet = getResultSet(query, transaction, baseRevision); |
115 | while(resultSet.next([this, resultProvider](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &value, Akonadi2::Operation operation) -> bool { | 113 | while(resultSet.next([this, resultProvider](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &value, Akonadi2::Operation operation) -> bool { |
116 | switch (operation) { | 114 | switch (operation) { |
diff --git a/common/genericresource.h b/common/genericresource.h index 532632e..2d171b6 100644 --- a/common/genericresource.h +++ b/common/genericresource.h | |||
@@ -29,6 +29,7 @@ class Processor; | |||
29 | 29 | ||
30 | namespace Akonadi2 | 30 | namespace Akonadi2 |
31 | { | 31 | { |
32 | class Pipeline; | ||
32 | 33 | ||
33 | /** | 34 | /** |
34 | * Generic Resource implementation. | 35 | * Generic Resource implementation. |
diff --git a/common/resource.h b/common/resource.h index 6563c09..1a97aeb 100644 --- a/common/resource.h +++ b/common/resource.h | |||
@@ -24,7 +24,6 @@ | |||
24 | 24 | ||
25 | namespace Akonadi2 | 25 | namespace Akonadi2 |
26 | { | 26 | { |
27 | class Pipeline; | ||
28 | class FacadeFactory; | 27 | class FacadeFactory; |
29 | 28 | ||
30 | /** | 29 | /** |
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index 512a13f..2c23f97 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -66,7 +66,9 @@ qint64 Storage::maxRevision(const Akonadi2::Storage::Transaction &transaction) | |||
66 | r = revision.toLongLong(); | 66 | r = revision.toLongLong(); |
67 | return false; | 67 | return false; |
68 | }, [](const Error &error){ | 68 | }, [](const Error &error){ |
69 | std::cout << "Coultn'd find uid for revision "; | 69 | if (error.code != Akonadi2::Storage::NotFound) { |
70 | std::cout << "Coultn'd find the maximum revision" << std::endl; | ||
71 | } | ||
70 | }); | 72 | }); |
71 | return r; | 73 | return r; |
72 | } | 74 | } |
@@ -78,7 +80,7 @@ QByteArray Storage::getUidFromRevision(const Akonadi2::Storage::Transaction &tra | |||
78 | uid = value; | 80 | uid = value; |
79 | return false; | 81 | return false; |
80 | }, [revision](const Error &error){ | 82 | }, [revision](const Error &error){ |
81 | std::cout << "Coultn'd find uid for revision " << revision; | 83 | std::cout << "Coultn'd find uid for revision " << revision << std::endl; |
82 | }); | 84 | }); |
83 | return uid; | 85 | return uid; |
84 | } | 86 | } |
@@ -90,7 +92,7 @@ QByteArray Storage::getTypeFromRevision(const Akonadi2::Storage::Transaction &tr | |||
90 | type = value; | 92 | type = value; |
91 | return false; | 93 | return false; |
92 | }, [revision](const Error &error){ | 94 | }, [revision](const Error &error){ |
93 | std::cout << "Coultn'd find type for revision " << revision; | 95 | std::cout << "Coultn'd find type for revision " << revision << std::endl; |
94 | }); | 96 | }); |
95 | return type; | 97 | return type; |
96 | } | 98 | } |