diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-26 14:23:23 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-26 14:23:23 +0200 |
commit | cb81ef8f69f6a48ed505f5aef50c62a10aa67283 (patch) | |
tree | e12b398c1a7f054d62bf3e9a26b8bb7b18b939f7 | |
parent | cf487248df311bd055844ce44786e28ea5aa7c2c (diff) | |
download | sink-cb81ef8f69f6a48ed505f5aef50c62a10aa67283.tar.gz sink-cb81ef8f69f6a48ed505f5aef50c62a10aa67283.zip |
Remove the store from the resource side.
...and shutdown the resource after we removed all data.
-rw-r--r-- | common/listener.cpp | 5 | ||||
-rw-r--r-- | examples/imapresource/tests/imapmailtest.cpp | 6 | ||||
-rw-r--r-- | examples/maildirresource/tests/maildirmailtest.cpp | 6 | ||||
-rw-r--r-- | tests/mailtest.cpp | 3 | ||||
-rw-r--r-- | 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 | |||
293 | } break; | 293 | } break; |
294 | case Sink::Commands::RemoveFromDiskCommand: { | 294 | case Sink::Commands::RemoveFromDiskCommand: { |
295 | Log() << QString("Received a remove from disk command from %1").arg(client.name); | 295 | Log() << QString("Received a remove from disk command from %1").arg(client.name); |
296 | m_resource->removeDataFromDisk(); | ||
297 | delete m_resource; | 296 | delete m_resource; |
298 | m_resource = nullptr; | 297 | m_resource = nullptr; |
299 | loadResource()->setLowerBoundRevision(0); | 298 | loadResource()->removeDataFromDisk(); |
299 | m_server->close(); | ||
300 | QTimer::singleShot(0, this, &Listener::quit); | ||
300 | } break; | 301 | } break; |
301 | default: | 302 | default: |
302 | if (commandId > Sink::Commands::CustomCommand) { | 303 | 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 @@ | |||
1 | #include <QtTest> | 1 | #include <QtTest> |
2 | 2 | ||
3 | #include <tests/mailtest.h> | 3 | #include <tests/mailtest.h> |
4 | #include "../imapresource.h" | ||
5 | 4 | ||
6 | #include "common/test.h" | 5 | #include "common/test.h" |
7 | #include "common/domain/applicationdomaintype.h" | 6 | #include "common/domain/applicationdomaintype.h" |
@@ -33,11 +32,6 @@ protected: | |||
33 | resource.setProperty("password", "doe"); | 32 | resource.setProperty("password", "doe"); |
34 | return resource; | 33 | return resource; |
35 | } | 34 | } |
36 | |||
37 | void removeResourceFromDisk(const QByteArray &identifier) Q_DECL_OVERRIDE | ||
38 | { | ||
39 | ::ImapResource::removeFromDisk(identifier); | ||
40 | } | ||
41 | }; | 35 | }; |
42 | 36 | ||
43 | QTEST_MAIN(ImapMailTest) | 37 | 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 @@ | |||
1 | #include <QtTest> | 1 | #include <QtTest> |
2 | 2 | ||
3 | #include <tests/mailtest.h> | 3 | #include <tests/mailtest.h> |
4 | #include "../maildirresource.h" | ||
5 | 4 | ||
6 | #include "common/test.h" | 5 | #include "common/test.h" |
7 | #include "common/domain/applicationdomaintype.h" | 6 | #include "common/domain/applicationdomaintype.h" |
@@ -33,11 +32,6 @@ protected: | |||
33 | resource.setProperty("path", targetPath); | 32 | resource.setProperty("path", targetPath); |
34 | return resource; | 33 | return resource; |
35 | } | 34 | } |
36 | |||
37 | void removeResourceFromDisk(const QByteArray &identifier) Q_DECL_OVERRIDE | ||
38 | { | ||
39 | ::MaildirResource::removeFromDisk(identifier); | ||
40 | } | ||
41 | }; | 35 | }; |
42 | 36 | ||
43 | QTEST_MAIN(MaildirMailTest) | 37 | 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() | |||
47 | 47 | ||
48 | void MailTest::cleanup() | 48 | void MailTest::cleanup() |
49 | { | 49 | { |
50 | VERIFYEXEC(ResourceControl::shutdown(mResourceInstanceIdentifier)); | 50 | VERIFYEXEC(Store::removeDataFromDisk(mResourceInstanceIdentifier)); |
51 | removeResourceFromDisk(mResourceInstanceIdentifier); | ||
52 | } | 51 | } |
53 | 52 | ||
54 | void MailTest::init() | 53 | 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: | |||
36 | 36 | ||
37 | virtual void resetTestEnvironment() = 0; | 37 | virtual void resetTestEnvironment() = 0; |
38 | virtual Sink::ApplicationDomain::SinkResource createResource() = 0; | 38 | virtual Sink::ApplicationDomain::SinkResource createResource() = 0; |
39 | virtual void removeResourceFromDisk(const QByteArray &mResourceInstanceIdentifier) = 0; | ||
40 | 39 | ||
41 | private slots: | 40 | private slots: |
42 | void initTestCase(); | 41 | void initTestCase(); |