summaryrefslogtreecommitdiffstats
path: root/synchronizer/listener.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-03-27 16:45:48 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-03-31 11:11:08 +0200
commit7642433a4fafd2ccf7e8b43c81ec18282f544a3b (patch)
tree067d1faa86061eabe24444e59118e9c1567848ba /synchronizer/listener.h
parentc9aeb8896ae578515c217b9a08988156b4d62f1e (diff)
downloadsink-7642433a4fafd2ccf7e8b43c81ec18282f544a3b.tar.gz
sink-7642433a4fafd2ccf7e8b43c81ec18282f544a3b.zip
Shutdown notification to achieve a clean shutdown.
Otherwise the client always restarts the resource because of the lost connection. We currently require this in tests to be able to delete the db, but eventually we likely want a "disable akonadi" function that shuts resources down, and keeps clients from restarting them (e.g. via configuration).
Diffstat (limited to 'synchronizer/listener.h')
-rw-r--r--synchronizer/listener.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/synchronizer/listener.h b/synchronizer/listener.h
index ee73766..8dad3a4 100644
--- a/synchronizer/listener.h
+++ b/synchronizer/listener.h
@@ -49,7 +49,7 @@ public:
49 } 49 }
50 50
51 QString name; 51 QString name;
52 QLocalSocket *socket; 52 QPointer<QLocalSocket> socket;
53 QByteArray commandBuffer; 53 QByteArray commandBuffer;
54}; 54};
55 55
@@ -74,12 +74,13 @@ private Q_SLOTS:
74 void readFromSocket(); 74 void readFromSocket();
75 void processClientBuffers(); 75 void processClientBuffers();
76 void refreshRevision(); 76 void refreshRevision();
77 void quit();
77 78
78private: 79private:
79 void processCommand(int commandId, uint messageId, Client &client, uint size, const std::function<void()> &callback); 80 void processCommand(int commandId, uint messageId, Client &client, uint size, const std::function<void()> &callback);
80 bool processClientBuffer(Client &client); 81 bool processClientBuffer(Client &client);
81 void sendCurrentRevision(Client &client); 82 void sendCurrentRevision(Client &client);
82 void sendCommandCompleted(Client &client, uint messageId); 83 void sendCommandCompleted(QLocalSocket *socket, uint messageId);
83 void updateClientsWithRevision(); 84 void updateClientsWithRevision();
84 void loadResource(); 85 void loadResource();
85 86