diff options
-rw-r--r-- | common/commandprocessor.cpp | 6 | ||||
-rw-r--r-- | common/commandprocessor.h | 2 | ||||
-rw-r--r-- | common/datastorequery.cpp | 9 | ||||
-rw-r--r-- | common/datastorequery.h | 3 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 8 | ||||
-rw-r--r-- | common/indexer.h | 1 | ||||
-rw-r--r-- | common/inspector.cpp | 5 | ||||
-rw-r--r-- | common/mailpreprocessor.cpp | 2 | ||||
-rw-r--r-- | common/pipeline.cpp | 4 | ||||
-rw-r--r-- | common/queryrunner.cpp | 2 | ||||
-rw-r--r-- | common/resource.h | 2 | ||||
-rw-r--r-- | common/resourceaccess.cpp | 1 | ||||
-rw-r--r-- | common/resultset.h | 1 | ||||
-rw-r--r-- | common/storage.h | 1 | ||||
-rw-r--r-- | common/storage/entitystore.cpp | 2 | ||||
-rw-r--r-- | common/storage_lmdb.cpp | 4 | ||||
-rw-r--r-- | common/synchronizer.cpp | 5 | ||||
-rw-r--r-- | sinksh/syntax_modules/sink_list.cpp | 2 | ||||
-rw-r--r-- | tests/clientapitest.cpp | 2 | ||||
-rw-r--r-- | tests/mailthreadtest.cpp | 2 |
20 files changed, 40 insertions, 24 deletions
diff --git a/common/commandprocessor.cpp b/common/commandprocessor.cpp index 87a120b..a6371be 100644 --- a/common/commandprocessor.cpp +++ b/common/commandprocessor.cpp | |||
@@ -380,3 +380,9 @@ KAsync::Job<void> CommandProcessor::processAllMessages() | |||
380 | } | 380 | } |
381 | }); | 381 | }); |
382 | } | 382 | } |
383 | |||
384 | #pragma clang diagnostic push | ||
385 | #pragma clang diagnostic ignored "-Wundefined-reinterpret-cast" | ||
386 | #include "commandprocessor.moc" | ||
387 | #include "moc_commandprocessor.cpp" | ||
388 | #pragma clang diagnostic pop | ||
diff --git a/common/commandprocessor.h b/common/commandprocessor.h index eeb7ecf..a4beed6 100644 --- a/common/commandprocessor.h +++ b/common/commandprocessor.h | |||
@@ -34,7 +34,7 @@ namespace Sink { | |||
34 | class Pipeline; | 34 | class Pipeline; |
35 | class Inspector; | 35 | class Inspector; |
36 | class Synchronizer; | 36 | class Synchronizer; |
37 | class QueuedCommand; | 37 | struct QueuedCommand; |
38 | class QueryBase; | 38 | class QueryBase; |
39 | 39 | ||
40 | /** | 40 | /** |
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp index 82a396e..d90d546 100644 --- a/common/datastorequery.cpp +++ b/common/datastorequery.cpp | |||
@@ -239,7 +239,7 @@ public: | |||
239 | } | 239 | } |
240 | 240 | ||
241 | QVariantList list; | 241 | QVariantList list; |
242 | for (const auto r : results) { | 242 | for (const auto &r : results) { |
243 | readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) { | 243 | readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) { |
244 | for (auto &aggregator : mAggregators) { | 244 | for (auto &aggregator : mAggregators) { |
245 | if (!aggregator.property.isEmpty()) { | 245 | if (!aggregator.property.isEmpty()) { |
@@ -293,7 +293,7 @@ public: | |||
293 | while(!foundValue && mSource->next([this, callback, &foundValue](const ResultSet::Result &result) { | 293 | while(!foundValue && mSource->next([this, callback, &foundValue](const ResultSet::Result &result) { |
294 | auto bloomValue = result.entity.getProperty(mBloomProperty); | 294 | auto bloomValue = result.entity.getProperty(mBloomProperty); |
295 | auto results = indexLookup(mBloomProperty, bloomValue); | 295 | auto results = indexLookup(mBloomProperty, bloomValue); |
296 | for (const auto r : results) { | 296 | for (const auto &r : results) { |
297 | readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) { | 297 | readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) { |
298 | callback({entity, Sink::Operation_Creation}); | 298 | callback({entity, Sink::Operation_Creation}); |
299 | foundValue = true; | 299 | foundValue = true; |
@@ -312,6 +312,11 @@ DataStoreQuery::DataStoreQuery(const Sink::QueryBase &query, const QByteArray &t | |||
312 | setupQuery(); | 312 | setupQuery(); |
313 | } | 313 | } |
314 | 314 | ||
315 | DataStoreQuery::~DataStoreQuery() | ||
316 | { | ||
317 | |||
318 | } | ||
319 | |||
315 | void DataStoreQuery::readEntity(const QByteArray &key, const BufferCallback &resultCallback) | 320 | void DataStoreQuery::readEntity(const QByteArray &key, const BufferCallback &resultCallback) |
316 | { | 321 | { |
317 | mStore.readLatest(mType, key, resultCallback); | 322 | mStore.readLatest(mType, key, resultCallback); |
diff --git a/common/datastorequery.h b/common/datastorequery.h index a4c8c18..4ac0e2d 100644 --- a/common/datastorequery.h +++ b/common/datastorequery.h | |||
@@ -33,6 +33,7 @@ public: | |||
33 | typedef QSharedPointer<DataStoreQuery> Ptr; | 33 | typedef QSharedPointer<DataStoreQuery> Ptr; |
34 | 34 | ||
35 | DataStoreQuery(const Sink::QueryBase &query, const QByteArray &type, Sink::Storage::EntityStore &store); | 35 | DataStoreQuery(const Sink::QueryBase &query, const QByteArray &type, Sink::Storage::EntityStore &store); |
36 | ~DataStoreQuery(); | ||
36 | ResultSet execute(); | 37 | ResultSet execute(); |
37 | ResultSet update(qint64 baseRevision); | 38 | ResultSet update(qint64 baseRevision); |
38 | 39 | ||
@@ -43,7 +44,7 @@ private: | |||
43 | 44 | ||
44 | QVector<QByteArray> indexLookup(const QByteArray &property, const QVariant &value); | 45 | QVector<QByteArray> indexLookup(const QByteArray &property, const QVariant &value); |
45 | 46 | ||
46 | virtual void readEntity(const QByteArray &key, const BufferCallback &resultCallback); | 47 | void readEntity(const QByteArray &key, const BufferCallback &resultCallback); |
47 | 48 | ||
48 | ResultSet createFilteredSet(ResultSet &resultSet, const FilterFunction &); | 49 | ResultSet createFilteredSet(ResultSet &resultSet, const FilterFunction &); |
49 | QVector<QByteArray> loadIncrementalResultSet(qint64 baseRevision); | 50 | QVector<QByteArray> loadIncrementalResultSet(qint64 baseRevision); |
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 60f5311..75438d5 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -73,18 +73,18 @@ ApplicationDomainType::ApplicationDomainType() | |||
73 | 73 | ||
74 | ApplicationDomainType::ApplicationDomainType(const QByteArray &resourceInstanceIdentifier) | 74 | ApplicationDomainType::ApplicationDomainType(const QByteArray &resourceInstanceIdentifier) |
75 | :mAdaptor(new MemoryBufferAdaptor()), | 75 | :mAdaptor(new MemoryBufferAdaptor()), |
76 | mResourceInstanceIdentifier(resourceInstanceIdentifier), | 76 | mChangeSet(new QSet<QByteArray>()), |
77 | mChangeSet(new QSet<QByteArray>()) | 77 | mResourceInstanceIdentifier(resourceInstanceIdentifier) |
78 | { | 78 | { |
79 | 79 | ||
80 | } | 80 | } |
81 | 81 | ||
82 | ApplicationDomainType::ApplicationDomainType(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) | 82 | ApplicationDomainType::ApplicationDomainType(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) |
83 | : mAdaptor(adaptor), | 83 | : mAdaptor(adaptor), |
84 | mChangeSet(new QSet<QByteArray>()), | ||
84 | mResourceInstanceIdentifier(resourceInstanceIdentifier), | 85 | mResourceInstanceIdentifier(resourceInstanceIdentifier), |
85 | mIdentifier(identifier), | 86 | mIdentifier(identifier), |
86 | mRevision(revision), | 87 | mRevision(revision) |
87 | mChangeSet(new QSet<QByteArray>()) | ||
88 | { | 88 | { |
89 | } | 89 | } |
90 | 90 | ||
diff --git a/common/indexer.h b/common/indexer.h index 7e148d1..26887fb 100644 --- a/common/indexer.h +++ b/common/indexer.h | |||
@@ -30,6 +30,7 @@ namespace ApplicationDomain { | |||
30 | class Indexer | 30 | class Indexer |
31 | { | 31 | { |
32 | public: | 32 | public: |
33 | virtual ~Indexer() = default; | ||
33 | typedef QSharedPointer<Indexer> Ptr; | 34 | typedef QSharedPointer<Indexer> Ptr; |
34 | virtual void add(const ApplicationDomain::ApplicationDomainType &entity) = 0; | 35 | virtual void add(const ApplicationDomain::ApplicationDomainType &entity) = 0; |
35 | virtual void modify(const ApplicationDomain::ApplicationDomainType &old, const ApplicationDomain::ApplicationDomainType &entity) = 0; | 36 | virtual void modify(const ApplicationDomain::ApplicationDomainType &old, const ApplicationDomain::ApplicationDomainType &entity) = 0; |
diff --git a/common/inspector.cpp b/common/inspector.cpp index 8b4c93a..78053a2 100644 --- a/common/inspector.cpp +++ b/common/inspector.cpp | |||
@@ -83,3 +83,8 @@ KAsync::Job<void> Inspector::inspect(int inspectionType, const QByteArray &inspe | |||
83 | return KAsync::error(-1, "Inspection not implemented."); | 83 | return KAsync::error(-1, "Inspection not implemented."); |
84 | } | 84 | } |
85 | 85 | ||
86 | #pragma clang diagnostic push | ||
87 | #pragma clang diagnostic ignored "-Wundefined-reinterpret-cast" | ||
88 | #include "inspector.moc" | ||
89 | #include "moc_inspector.cpp" | ||
90 | #pragma clang diagnostic pop | ||
diff --git a/common/mailpreprocessor.cpp b/common/mailpreprocessor.cpp index 1366718..dff3b3d 100644 --- a/common/mailpreprocessor.cpp +++ b/common/mailpreprocessor.cpp | |||
@@ -91,7 +91,7 @@ static Sink::ApplicationDomain::Mail::Contact getContact(const KMime::Headers::G | |||
91 | static QList<Sink::ApplicationDomain::Mail::Contact> getContactList(const KMime::Headers::Generics::AddressList *header) | 91 | static QList<Sink::ApplicationDomain::Mail::Contact> getContactList(const KMime::Headers::Generics::AddressList *header) |
92 | { | 92 | { |
93 | QList<Sink::ApplicationDomain::Mail::Contact> list; | 93 | QList<Sink::ApplicationDomain::Mail::Contact> list; |
94 | for (const auto mb : header->mailboxes()) { | 94 | for (const auto &mb : header->mailboxes()) { |
95 | list << Sink::ApplicationDomain::Mail::Contact{mb.name(), mb.address()}; | 95 | list << Sink::ApplicationDomain::Mail::Contact{mb.name(), mb.address()}; |
96 | } | 96 | } |
97 | return list; | 97 | return list; |
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 32f6454..701c720 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -41,8 +41,6 @@ | |||
41 | #include "storage/entitystore.h" | 41 | #include "storage/entitystore.h" |
42 | #include "store.h" | 42 | #include "store.h" |
43 | 43 | ||
44 | SINK_DEBUG_AREA("pipeline") | ||
45 | |||
46 | using namespace Sink; | 44 | using namespace Sink; |
47 | using namespace Sink::Storage; | 45 | using namespace Sink::Storage; |
48 | 46 | ||
@@ -271,7 +269,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
271 | } | 269 | } |
272 | 270 | ||
273 | // Remove deletions | 271 | // Remove deletions |
274 | for (const auto property : deletions) { | 272 | for (const auto &property : deletions) { |
275 | newEntity.setProperty(property, QVariant()); | 273 | newEntity.setProperty(property, QVariant()); |
276 | } | 274 | } |
277 | newEntity.setResource(targetResource); | 275 | newEntity.setResource(targetResource); |
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index 6730894..0862378 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp | |||
@@ -26,8 +26,6 @@ | |||
26 | #include "asyncutils.h" | 26 | #include "asyncutils.h" |
27 | #include "datastorequery.h" | 27 | #include "datastorequery.h" |
28 | 28 | ||
29 | SINK_DEBUG_AREA("queryrunner") | ||
30 | |||
31 | using namespace Sink; | 29 | using namespace Sink; |
32 | using namespace Sink::Storage; | 30 | using namespace Sink::Storage; |
33 | 31 | ||
diff --git a/common/resource.h b/common/resource.h index d756521..046f236 100644 --- a/common/resource.h +++ b/common/resource.h | |||
@@ -27,7 +27,7 @@ | |||
27 | namespace Sink { | 27 | namespace Sink { |
28 | class FacadeFactory; | 28 | class FacadeFactory; |
29 | class AdaptorFactoryRegistry; | 29 | class AdaptorFactoryRegistry; |
30 | class ResourceContext; | 30 | struct ResourceContext; |
31 | class QueryBase; | 31 | class QueryBase; |
32 | 32 | ||
33 | /** | 33 | /** |
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 29d5a1c..4885b9f 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -220,7 +220,6 @@ KAsync::Job<void> ResourceAccess::Private::initializeSocket() | |||
220 | SinkWarning() << "Failed to start resource"; | 220 | SinkWarning() << "Failed to start resource"; |
221 | return KAsync::error(-1, "Failed to start resource"); | 221 | return KAsync::error(-1, "Failed to start resource"); |
222 | } | 222 | } |
223 | return KAsync::null(); | ||
224 | } else { | 223 | } else { |
225 | SinkTrace() << "Connected to resource, without having to start it."; | 224 | SinkTrace() << "Connected to resource, without having to start it."; |
226 | Q_ASSERT(s); | 225 | Q_ASSERT(s); |
diff --git a/common/resultset.h b/common/resultset.h index db7d1e0..707bc7e 100644 --- a/common/resultset.h +++ b/common/resultset.h | |||
@@ -35,6 +35,7 @@ class ResultSet | |||
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | struct Result { | 37 | struct Result { |
38 | Result(const Sink::ApplicationDomain::ApplicationDomainType &e, Sink::Operation op, const QMap<QByteArray, QVariant> &v = QMap<QByteArray, QVariant>{}) : entity(e), operation(op), aggregateValues(v) {} | ||
38 | Sink::ApplicationDomain::ApplicationDomainType entity; | 39 | Sink::ApplicationDomain::ApplicationDomainType entity; |
39 | Sink::Operation operation; | 40 | Sink::Operation operation; |
40 | QMap<QByteArray, QVariant> aggregateValues; | 41 | QMap<QByteArray, QVariant> aggregateValues; |
diff --git a/common/storage.h b/common/storage.h index 039a54f..a8e14a6 100644 --- a/common/storage.h +++ b/common/storage.h | |||
@@ -216,4 +216,3 @@ private: | |||
216 | } // namespace Sink | 216 | } // namespace Sink |
217 | 217 | ||
218 | QDebug& SINK_EXPORT operator<<(QDebug &dbg, const Sink::Storage::DataStore::Error &error); | 218 | QDebug& SINK_EXPORT operator<<(QDebug &dbg, const Sink::Storage::DataStore::Error &error); |
219 | |||
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp index 055499c..b1b3c86 100644 --- a/common/storage/entitystore.cpp +++ b/common/storage/entitystore.cpp | |||
@@ -228,7 +228,7 @@ bool EntityStore::modify(const QByteArray &type, const ApplicationDomain::Applic | |||
228 | } | 228 | } |
229 | 229 | ||
230 | // Remove deletions | 230 | // Remove deletions |
231 | for (const auto property : deletions) { | 231 | for (const auto &property : deletions) { |
232 | //SinkTrace() << "Removing property: " << property; | 232 | //SinkTrace() << "Removing property: " << property; |
233 | newEntity.setProperty(property, QVariant()); | 233 | newEntity.setProperty(property, QVariant()); |
234 | } | 234 | } |
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index fa99a80..f534029 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -41,6 +41,10 @@ SINK_DEBUG_AREA("storage") | |||
41 | namespace Sink { | 41 | namespace Sink { |
42 | namespace Storage { | 42 | namespace Storage { |
43 | 43 | ||
44 | extern QMutex sMutex; | ||
45 | extern QHash<QString, MDB_env *> sEnvironments; | ||
46 | |||
47 | |||
44 | QMutex sMutex; | 48 | QMutex sMutex; |
45 | QHash<QString, MDB_env *> sEnvironments; | 49 | QHash<QString, MDB_env *> sEnvironments; |
46 | 50 | ||
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index bb1a3f4..a341f63 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp | |||
@@ -488,3 +488,8 @@ bool Synchronizer::allChangesReplayed() | |||
488 | 488 | ||
489 | SINK_REGISTER_TYPES() | 489 | SINK_REGISTER_TYPES() |
490 | 490 | ||
491 | #pragma clang diagnostic push | ||
492 | #pragma clang diagnostic ignored "-Wundefined-reinterpret-cast" | ||
493 | #include "synchronizer.moc" | ||
494 | #include "moc_synchronizer.cpp" | ||
495 | #pragma clang diagnostic pop | ||
diff --git a/sinksh/syntax_modules/sink_list.cpp b/sinksh/syntax_modules/sink_list.cpp index f9cda1a..feb582e 100644 --- a/sinksh/syntax_modules/sink_list.cpp +++ b/sinksh/syntax_modules/sink_list.cpp | |||
@@ -37,8 +37,6 @@ | |||
37 | #include "state.h" | 37 | #include "state.h" |
38 | #include "syntaxtree.h" | 38 | #include "syntaxtree.h" |
39 | 39 | ||
40 | SINK_DEBUG_AREA("sinksh_list") | ||
41 | |||
42 | namespace SinkList | 40 | namespace SinkList |
43 | { | 41 | { |
44 | 42 | ||
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 8fc76df..159789f 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp | |||
@@ -10,8 +10,6 @@ | |||
10 | #include "facadefactory.h" | 10 | #include "facadefactory.h" |
11 | #include "test.h" | 11 | #include "test.h" |
12 | 12 | ||
13 | SINK_DEBUG_AREA("clientapitest") | ||
14 | |||
15 | template <typename T> | 13 | template <typename T> |
16 | class TestDummyResourceFacade : public Sink::StoreFacade<T> | 14 | class TestDummyResourceFacade : public Sink::StoreFacade<T> |
17 | { | 15 | { |
diff --git a/tests/mailthreadtest.cpp b/tests/mailthreadtest.cpp index 82f9331..02b29f6 100644 --- a/tests/mailthreadtest.cpp +++ b/tests/mailthreadtest.cpp | |||
@@ -32,8 +32,6 @@ | |||
32 | using namespace Sink; | 32 | using namespace Sink; |
33 | using namespace Sink::ApplicationDomain; | 33 | using namespace Sink::ApplicationDomain; |
34 | 34 | ||
35 | SINK_DEBUG_AREA("mailthreadtest") | ||
36 | |||
37 | //TODO extract resource test | 35 | //TODO extract resource test |
38 | // | 36 | // |
39 | void MailThreadTest::initTestCase() | 37 | void MailThreadTest::initTestCase() |