summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/domain/applicationdomaintype.cpp30
-rw-r--r--common/domain/applicationdomaintype.h7
-rw-r--r--common/genericresource.cpp1
-rw-r--r--common/log.cpp14
-rw-r--r--common/propertymapper.h4
-rw-r--r--common/resourceaccess.cpp3
-rw-r--r--common/resultprovider.h13
-rw-r--r--common/storage_lmdb.cpp2
8 files changed, 63 insertions, 11 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp
index b0433be..fccf082 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -100,6 +100,36 @@ QByteArray ApplicationDomainType::identifier() const
100 return mIdentifier; 100 return mIdentifier;
101} 101}
102 102
103Entity::~Entity()
104{
105
106}
107
108Event::~Event()
109{
110
111}
112
113Todo::~Todo()
114{
115
116}
117
118Mail::~Mail()
119{
120
121}
122
123Folder::~Folder()
124{
125
126}
127
128SinkResource::~SinkResource()
129{
130
131}
132
103template<> 133template<>
104QByteArray getTypeName<Event>() 134QByteArray getTypeName<Event>()
105{ 135{
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h
index 63f030c..88f094a 100644
--- a/common/domain/applicationdomaintype.h
+++ b/common/domain/applicationdomaintype.h
@@ -85,31 +85,37 @@ inline bool operator==(const ApplicationDomainType& lhs, const ApplicationDomain
85struct Entity : public ApplicationDomainType { 85struct Entity : public ApplicationDomainType {
86 typedef QSharedPointer<Entity> Ptr; 86 typedef QSharedPointer<Entity> Ptr;
87 using ApplicationDomainType::ApplicationDomainType; 87 using ApplicationDomainType::ApplicationDomainType;
88 virtual ~Entity();
88}; 89};
89 90
90struct Event : public Entity { 91struct Event : public Entity {
91 typedef QSharedPointer<Event> Ptr; 92 typedef QSharedPointer<Event> Ptr;
92 using Entity::Entity; 93 using Entity::Entity;
94 virtual ~Event();
93}; 95};
94 96
95struct Todo : public Entity { 97struct Todo : public Entity {
96 typedef QSharedPointer<Todo> Ptr; 98 typedef QSharedPointer<Todo> Ptr;
97 using Entity::Entity; 99 using Entity::Entity;
100 virtual ~Todo();
98}; 101};
99 102
100struct Calendar : public Entity { 103struct Calendar : public Entity {
101 typedef QSharedPointer<Calendar> Ptr; 104 typedef QSharedPointer<Calendar> Ptr;
102 using Entity::Entity; 105 using Entity::Entity;
106 virtual ~Calendar();
103}; 107};
104 108
105struct Mail : public Entity { 109struct Mail : public Entity {
106 typedef QSharedPointer<Mail> Ptr; 110 typedef QSharedPointer<Mail> Ptr;
107 using Entity::Entity; 111 using Entity::Entity;
112 virtual ~Mail();
108}; 113};
109 114
110struct Folder : public Entity { 115struct Folder : public Entity {
111 typedef QSharedPointer<Folder> Ptr; 116 typedef QSharedPointer<Folder> Ptr;
112 using Entity::Entity; 117 using Entity::Entity;
118 virtual ~Folder();
113}; 119};
114 120
115/** 121/**
@@ -121,6 +127,7 @@ struct Folder : public Entity {
121struct SinkResource : public ApplicationDomainType { 127struct SinkResource : public ApplicationDomainType {
122 typedef QSharedPointer<SinkResource> Ptr; 128 typedef QSharedPointer<SinkResource> Ptr;
123 using ApplicationDomainType::ApplicationDomainType; 129 using ApplicationDomainType::ApplicationDomainType;
130 virtual ~SinkResource();
124}; 131};
125 132
126/** 133/**
diff --git a/common/genericresource.cpp b/common/genericresource.cpp
index c7326d3..758ea0d 100644
--- a/common/genericresource.cpp
+++ b/common/genericresource.cpp
@@ -197,7 +197,6 @@ private slots:
197 default: 197 default:
198 return KAsync::error<qint64>(-1, "Unhandled command"); 198 return KAsync::error<qint64>(-1, "Unhandled command");
199 } 199 }
200 return KAsync::null<qint64>();
201 } 200 }
202 201
203 KAsync::Job<qint64, qint64> processQueuedCommand(const QByteArray &data) 202 KAsync::Job<qint64, qint64> processQueuedCommand(const QByteArray &data)
diff --git a/common/log.cpp b/common/log.cpp
index 45bbec1..316031d 100644
--- a/common/log.cpp
+++ b/common/log.cpp
@@ -17,7 +17,7 @@ public:
17 { 17 {
18 open(WriteOnly); 18 open(WriteOnly);
19 } 19 }
20 virtual ~DebugStream(){}; 20 virtual ~DebugStream();
21 21
22 bool isSequential() const { return true; } 22 bool isSequential() const { return true; }
23 qint64 readData(char *, qint64) { return 0; /* eof */ } 23 qint64 readData(char *, qint64) { return 0; /* eof */ }
@@ -35,6 +35,10 @@ private:
35 Q_DISABLE_COPY(DebugStream) 35 Q_DISABLE_COPY(DebugStream)
36}; 36};
37 37
38//Virtual method anchor
39DebugStream::~DebugStream()
40{}
41
38class NullStream: public QIODevice 42class NullStream: public QIODevice
39{ 43{
40public: 44public:
@@ -43,7 +47,7 @@ public:
43 { 47 {
44 open(WriteOnly); 48 open(WriteOnly);
45 } 49 }
46 virtual ~NullStream(){}; 50 virtual ~NullStream();
47 51
48 bool isSequential() const { return true; } 52 bool isSequential() const { return true; }
49 qint64 readData(char *, qint64) { return 0; /* eof */ } 53 qint64 readData(char *, qint64) { return 0; /* eof */ }
@@ -56,6 +60,10 @@ private:
56 Q_DISABLE_COPY(NullStream) 60 Q_DISABLE_COPY(NullStream)
57}; 61};
58 62
63//Virtual method anchor
64NullStream::~NullStream()
65{}
66
59 /* 67 /*
60 * ANSI color codes: 68 * ANSI color codes:
61 * 0: reset colors/style 69 * 0: reset colors/style
@@ -175,8 +183,6 @@ QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char* file,
175 prefix = "Error: "; 183 prefix = "Error: ";
176 prefixColorCode = ANSI_Colors::Red; 184 prefixColorCode = ANSI_Colors::Red;
177 break; 185 break;
178 default:
179 break;
180 }; 186 };
181 187
182 bool showLocation = false; 188 bool showLocation = false;
diff --git a/common/propertymapper.h b/common/propertymapper.h
index efde72c..94c9224 100644
--- a/common/propertymapper.h
+++ b/common/propertymapper.h
@@ -52,6 +52,8 @@ template<typename BufferType>
52class ReadPropertyMapper 52class ReadPropertyMapper
53{ 53{
54public: 54public:
55 virtual ~ReadPropertyMapper(){};
56
55 virtual QVariant getProperty(const QByteArray &key, BufferType const *buffer) const 57 virtual QVariant getProperty(const QByteArray &key, BufferType const *buffer) const
56 { 58 {
57 if (mReadAccessors.contains(key)) { 59 if (mReadAccessors.contains(key)) {
@@ -106,6 +108,8 @@ template<typename BufferBuilder>
106class WritePropertyMapper 108class WritePropertyMapper
107{ 109{
108public: 110public:
111 virtual ~WritePropertyMapper(){};
112
109 virtual void setProperty(const QByteArray &key, const QVariant &value, QList<std::function<void(BufferBuilder &)> > &builderCalls, flatbuffers::FlatBufferBuilder &fbb) const 113 virtual void setProperty(const QByteArray &key, const QVariant &value, QList<std::function<void(BufferBuilder &)> > &builderCalls, flatbuffers::FlatBufferBuilder &fbb) const
110 { 114 {
111 if (mWriteAccessors.contains(key)) { 115 if (mWriteAccessors.contains(key)) {
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp
index 0c435c9..8296f1d 100644
--- a/common/resourceaccess.cpp
+++ b/common/resourceaccess.cpp
@@ -566,6 +566,9 @@ bool ResourceAccess::processMessageBuffer()
566 }, this); 566 }, this);
567 } 567 }
568 break; 568 break;
569 case Sink::Commands::NotificationType::NotificationType_Status:
570 case Sink::Commands::NotificationType::NotificationType_Warning:
571 case Sink::Commands::NotificationType::NotificationType_Progress:
569 default: 572 default:
570 Warning() << "Received unknown notification: " << buffer->type(); 573 Warning() << "Received unknown notification: " << buffer->type();
571 break; 574 break;
diff --git a/common/resultprovider.h b/common/resultprovider.h
index 6958dbf..2d6efbe 100644
--- a/common/resultprovider.h
+++ b/common/resultprovider.h
@@ -27,8 +27,6 @@
27#include "resultset.h" 27#include "resultset.h"
28#include "log.h" 28#include "log.h"
29 29
30using namespace async;
31
32namespace Sink { 30namespace Sink {
33 31
34/** 32/**
@@ -47,6 +45,11 @@ public:
47 45
48 } 46 }
49 47
48 virtual ~ResultProviderInterface()
49 {
50
51 }
52
50 virtual void add(const T &value) = 0; 53 virtual void add(const T &value) = 0;
51 virtual void modify(const T &value) = 0; 54 virtual void modify(const T &value) = 0;
52 virtual void remove(const T &value) = 0; 55 virtual void remove(const T &value) = 0;
@@ -183,7 +186,7 @@ public:
183 186
184 void onDone(const std::function<void()> &callback) 187 void onDone(const std::function<void()> &callback)
185 { 188 {
186 mThreadBoundary = QSharedPointer<ThreadBoundary>::create(); 189 mThreadBoundary = QSharedPointer<async::ThreadBoundary>::create();
187 mOnDoneCallback = callback; 190 mOnDoneCallback = callback;
188 } 191 }
189 192
@@ -212,7 +215,7 @@ private:
212 215
213 QWeakPointer<ResultEmitter<T> > mResultEmitter; 216 QWeakPointer<ResultEmitter<T> > mResultEmitter;
214 std::function<void()> mOnDoneCallback; 217 std::function<void()> mOnDoneCallback;
215 QSharedPointer<ThreadBoundary> mThreadBoundary; 218 QSharedPointer<async::ThreadBoundary> mThreadBoundary;
216 std::function<void(const T &parent)> mFetcher; 219 std::function<void(const T &parent)> mFetcher;
217}; 220};
218 221
@@ -327,7 +330,7 @@ private:
327 std::function<void(void)> clearHandler; 330 std::function<void(void)> clearHandler;
328 331
329 std::function<void(const DomainType &parent)> mFetcher; 332 std::function<void(const DomainType &parent)> mFetcher;
330 ThreadBoundary mThreadBoundary; 333 async::ThreadBoundary mThreadBoundary;
331}; 334};
332 335
333template<class DomainType> 336template<class DomainType>
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp
index 893c37c..e2c623e 100644
--- a/common/storage_lmdb.cpp
+++ b/common/storage_lmdb.cpp
@@ -443,8 +443,8 @@ Storage::NamedDatabase Storage::Transaction::openDatabase(const QByteArray &db,
443 d->implicitCommit = true; 443 d->implicitCommit = true;
444 auto p = new Storage::NamedDatabase::Private(db, allowDuplicates, d->defaultErrorHandler, d->name, d->transaction); 444 auto p = new Storage::NamedDatabase::Private(db, allowDuplicates, d->defaultErrorHandler, d->name, d->transaction);
445 if (!p->openDatabase(d->requestedRead, errorHandler)) { 445 if (!p->openDatabase(d->requestedRead, errorHandler)) {
446 return Storage::NamedDatabase();
447 delete p; 446 delete p;
447 return Storage::NamedDatabase();
448 } 448 }
449 return Storage::NamedDatabase(p); 449 return Storage::NamedDatabase(p);
450} 450}