From cb81ef8f69f6a48ed505f5aef50c62a10aa67283 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 26 Jun 2016 14:23:23 +0200 Subject: Remove the store from the resource side. ...and shutdown the resource after we removed all data. --- common/listener.cpp | 5 +++-- examples/imapresource/tests/imapmailtest.cpp | 6 ------ examples/maildirresource/tests/maildirmailtest.cpp | 6 ------ tests/mailtest.cpp | 3 +-- tests/mailtest.h | 1 - 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/common/listener.cpp b/common/listener.cpp index cb974cf..84afe16 100644 --- a/common/listener.cpp +++ b/common/listener.cpp @@ -293,10 +293,11 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c } break; case Sink::Commands::RemoveFromDiskCommand: { Log() << QString("Received a remove from disk command from %1").arg(client.name); - m_resource->removeDataFromDisk(); delete m_resource; m_resource = nullptr; - loadResource()->setLowerBoundRevision(0); + loadResource()->removeDataFromDisk(); + m_server->close(); + QTimer::singleShot(0, this, &Listener::quit); } break; default: if (commandId > Sink::Commands::CustomCommand) { diff --git a/examples/imapresource/tests/imapmailtest.cpp b/examples/imapresource/tests/imapmailtest.cpp index d17d7da..c94a731 100644 --- a/examples/imapresource/tests/imapmailtest.cpp +++ b/examples/imapresource/tests/imapmailtest.cpp @@ -1,7 +1,6 @@ #include #include -#include "../imapresource.h" #include "common/test.h" #include "common/domain/applicationdomaintype.h" @@ -33,11 +32,6 @@ protected: resource.setProperty("password", "doe"); return resource; } - - void removeResourceFromDisk(const QByteArray &identifier) Q_DECL_OVERRIDE - { - ::ImapResource::removeFromDisk(identifier); - } }; QTEST_MAIN(ImapMailTest) diff --git a/examples/maildirresource/tests/maildirmailtest.cpp b/examples/maildirresource/tests/maildirmailtest.cpp index caaf552..a3fc772 100644 --- a/examples/maildirresource/tests/maildirmailtest.cpp +++ b/examples/maildirresource/tests/maildirmailtest.cpp @@ -1,7 +1,6 @@ #include #include -#include "../maildirresource.h" #include "common/test.h" #include "common/domain/applicationdomaintype.h" @@ -33,11 +32,6 @@ protected: resource.setProperty("path", targetPath); return resource; } - - void removeResourceFromDisk(const QByteArray &identifier) Q_DECL_OVERRIDE - { - ::MaildirResource::removeFromDisk(identifier); - } }; QTEST_MAIN(MaildirMailTest) diff --git a/tests/mailtest.cpp b/tests/mailtest.cpp index 541656f..b9d496d 100644 --- a/tests/mailtest.cpp +++ b/tests/mailtest.cpp @@ -47,8 +47,7 @@ void MailTest::initTestCase() void MailTest::cleanup() { - VERIFYEXEC(ResourceControl::shutdown(mResourceInstanceIdentifier)); - removeResourceFromDisk(mResourceInstanceIdentifier); + VERIFYEXEC(Store::removeDataFromDisk(mResourceInstanceIdentifier)); } void MailTest::init() diff --git a/tests/mailtest.h b/tests/mailtest.h index 362e044..2144bf1 100644 --- a/tests/mailtest.h +++ b/tests/mailtest.h @@ -36,7 +36,6 @@ protected: virtual void resetTestEnvironment() = 0; virtual Sink::ApplicationDomain::SinkResource createResource() = 0; - virtual void removeResourceFromDisk(const QByteArray &mResourceInstanceIdentifier) = 0; private slots: void initTestCase(); -- cgit v1.2.3