summaryrefslogtreecommitdiffstats
path: root/common/listener.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-08 21:34:06 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-08 21:34:06 +0100
commit44744e281a56488c7ef257e12ca379ec4ceb2cdd (patch)
tree5fd45d6c6cf5e68ba2323fac3f498c6afa6f2ddf /common/listener.cpp
parentd82f0f6e52b601c3067ca70183458f5ce9b22c22 (diff)
downloadsink-44744e281a56488c7ef257e12ca379ec4ceb2cdd.tar.gz
sink-44744e281a56488c7ef257e12ca379ec4ceb2cdd.zip
Executed database removal in the resource instead of the client.
The resource doesn't really notify all clients properly about the removal, but the tests all still pass.
Diffstat (limited to 'common/listener.cpp')
-rw-r--r--common/listener.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/listener.cpp b/common/listener.cpp
index 323252b..d2fa266 100644
--- a/common/listener.cpp
+++ b/common/listener.cpp
@@ -275,6 +275,14 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c
275 loadResource()->setLowerBoundRevision(lowerBoundRevision()); 275 loadResource()->setLowerBoundRevision(lowerBoundRevision());
276 } 276 }
277 break; 277 break;
278 case Sink::Commands::RemoveFromDiskCommand: {
279 Log() << QString("\tReceived a remove from disk command from %1").arg(client.name);
280 m_resource->removeDataFromDisk();
281 delete m_resource;
282 m_resource = nullptr;
283 loadResource()->setLowerBoundRevision(0);
284 }
285 break;
278 default: 286 default:
279 if (commandId > Sink::Commands::CustomCommand) { 287 if (commandId > Sink::Commands::CustomCommand) {
280 Log() << QString("\tReceived custom command from %1: ").arg(client.name) << commandId; 288 Log() << QString("\tReceived custom command from %1: ").arg(client.name) << commandId;