summaryrefslogtreecommitdiffstats
path: root/synchronizer/listener.h
diff options
context:
space:
mode:
authorAaron Seigo <aseigo@kde.org>2014-12-16 12:14:38 +0100
committerAaron Seigo <aseigo@kde.org>2014-12-16 12:14:38 +0100
commit8ae840ac13d9e2161b411fbceae281a725fa8b1f (patch)
tree743fbaf8ba404db97995b336db27228ce7f6eff4 /synchronizer/listener.h
parentce9498597c789453db5f3b770f0f21fc119f404f (diff)
downloadsink-8ae840ac13d9e2161b411fbceae281a725fa8b1f.tar.gz
sink-8ae840ac13d9e2161b411fbceae281a725fa8b1f.zip
load the resource on first command .. it LIIIIVES!
Diffstat (limited to 'synchronizer/listener.h')
-rw-r--r--synchronizer/listener.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/synchronizer/listener.h b/synchronizer/listener.h
index b20da7f..5c725df 100644
--- a/synchronizer/listener.h
+++ b/synchronizer/listener.h
@@ -26,26 +26,28 @@
26 26
27#include <flatbuffers/flatbuffers.h> 27#include <flatbuffers/flatbuffers.h>
28 28
29namespace Akonadi2
30{
31 class Resource;
32}
33
29class Client 34class Client
30{ 35{
31public: 36public:
32 Client() 37 Client()
33 : socket(nullptr), 38 : socket(nullptr)
34 hasSentCommand(false)
35 { 39 {
36 } 40 }
37 41
38 Client(const QString &n, QLocalSocket *s) 42 Client(const QString &n, QLocalSocket *s)
39 : name(n), 43 : name(n),
40 socket(s), 44 socket(s)
41 hasSentCommand(false)
42 { 45 {
43 } 46 }
44 47
45 QString name; 48 QString name;
46 QLocalSocket *socket; 49 QLocalSocket *socket;
47 QByteArray commandBuffer; 50 QByteArray commandBuffer;
48 bool hasSentCommand;
49}; 51};
50 52
51class Listener : public QObject 53class Listener : public QObject
@@ -75,8 +77,12 @@ private:
75 bool processClientBuffer(Client &client); 77 bool processClientBuffer(Client &client);
76 void sendCurrentRevision(Client &client); 78 void sendCurrentRevision(Client &client);
77 void updateClientsWithRevision(); 79 void updateClientsWithRevision();
80 void loadResource();
81
78 QLocalServer *m_server; 82 QLocalServer *m_server;
79 QVector<Client> m_connections; 83 QVector<Client> m_connections;
80 unsigned long long m_revision; 84 unsigned long long m_revision;
81 flatbuffers::FlatBufferBuilder m_fbb; 85 flatbuffers::FlatBufferBuilder m_fbb;
86 const QString m_resourceName;
87 Akonadi2::Resource *m_resource;
82}; 88};