summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-17 13:50:55 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-17 13:50:55 +0100
commitf55536fbd27769ccb522a64621545f47f07e375f (patch)
tree0d337fe1a38df06f37c7466097db330412a1091a
parent61a03997eec979aa46337347402dc6358bc8b4d1 (diff)
downloadsink-f55536fbd27769ccb522a64621545f47f07e375f.tar.gz
sink-f55536fbd27769ccb522a64621545f47f07e375f.zip
Removed an unnecessary member variable
-rw-r--r--common/genericresource.cpp11
-rw-r--r--common/genericresource.h1
-rw-r--r--examples/dummyresource/resourcefactory.cpp2
-rw-r--r--examples/maildirresource/maildirresource.cpp4
4 files changed, 5 insertions, 13 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp
index 4250a02..5e6764a 100644
--- a/common/genericresource.cpp
+++ b/common/genericresource.cpp
@@ -327,12 +327,11 @@ int GenericResource::error() const
327 327
328void GenericResource::enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data) 328void GenericResource::enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data)
329{ 329{
330 //TODO get rid of m_fbb member variable 330 flatbuffers::FlatBufferBuilder fbb;
331 m_fbb.Clear(); 331 auto commandData = Akonadi2::EntityBuffer::appendAsVector(fbb, data.constData(), data.size());
332 auto commandData = Akonadi2::EntityBuffer::appendAsVector(m_fbb, data.constData(), data.size()); 332 auto buffer = Akonadi2::CreateQueuedCommand(fbb, commandId, commandData);
333 auto buffer = Akonadi2::CreateQueuedCommand(m_fbb, commandId, commandData); 333 Akonadi2::FinishQueuedCommandBuffer(fbb, buffer);
334 Akonadi2::FinishQueuedCommandBuffer(m_fbb, buffer); 334 mq.enqueue(fbb.GetBufferPointer(), fbb.GetSize());
335 mq.enqueue(m_fbb.GetBufferPointer(), m_fbb.GetSize());
336} 335}
337 336
338void GenericResource::processCommand(int commandId, const QByteArray &data) 337void GenericResource::processCommand(int commandId, const QByteArray &data)
diff --git a/common/genericresource.h b/common/genericresource.h
index 82c8a49..1aa4206 100644
--- a/common/genericresource.h
+++ b/common/genericresource.h
@@ -60,7 +60,6 @@ protected:
60 virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value); 60 virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value);
61 void onProcessorError(int errorCode, const QString &errorMessage); 61 void onProcessorError(int errorCode, const QString &errorMessage);
62 void enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data); 62 void enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data);
63 flatbuffers::FlatBufferBuilder m_fbb;
64 MessageQueue mUserQueue; 63 MessageQueue mUserQueue;
65 MessageQueue mSynchronizerQueue; 64 MessageQueue mSynchronizerQueue;
66 QByteArray mResourceInstanceIdentifier; 65 QByteArray mResourceInstanceIdentifier;
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp
index 6bb87f6..a24ff27 100644
--- a/examples/dummyresource/resourcefactory.cpp
+++ b/examples/dummyresource/resourcefactory.cpp
@@ -123,8 +123,6 @@ void DummyResource::synchronize(const QString &bufferType, const QMap<QString, Q
123 }, true); 123 }, true);
124 124
125 if (!found) { //A new entity 125 if (!found) { //A new entity
126 m_fbb.Clear();
127
128 flatbuffers::FlatBufferBuilder entityFbb; 126 flatbuffers::FlatBufferBuilder entityFbb;
129 createEntity(remoteId, it.value(), entityFbb, synchronizationTransaction); 127 createEntity(remoteId, it.value(), entityFbb, synchronizationTransaction);
130 128
diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp
index 909eb10..9769444 100644
--- a/examples/maildirresource/maildirresource.cpp
+++ b/examples/maildirresource/maildirresource.cpp
@@ -121,8 +121,6 @@ void MaildirResource::synchronizeFolders(Akonadi2::Storage::Transaction &transac
121 }, true); 121 }, true);
122 122
123 if (!found) { //A new entity 123 if (!found) { //A new entity
124 m_fbb.Clear();
125
126 KPIM::Maildir md(folder, folder == mMaildirPath); 124 KPIM::Maildir md(folder, folder == mMaildirPath);
127 125
128 Akonadi2::ApplicationDomain::Folder folder; 126 Akonadi2::ApplicationDomain::Folder folder;
@@ -189,8 +187,6 @@ void MaildirResource::synchronizeMails(Akonadi2::Storage::Transaction &transacti
189 }, true); 187 }, true);
190 188
191 if (!found) { //A new entity 189 if (!found) { //A new entity
192 m_fbb.Clear();
193
194 KMime::Message *msg = new KMime::Message; 190 KMime::Message *msg = new KMime::Message;
195 auto filepath = listingPath + QDir::separator() + fileName; 191 auto filepath = listingPath + QDir::separator() + fileName;
196 msg->setHead(KMime::CRLFtoLF(maildir.readEntryHeadersFromFile(filepath))); 192 msg->setHead(KMime::CRLFtoLF(maildir.readEntryHeadersFromFile(filepath)));