[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [sink/develop] /: Remove the store from the resource side.
From:       Christian Mollekopf <chrigi_1 () fastmail ! fm>
Date:       2016-06-30 19:49:33
Message-ID: E1bIhxt-0005c3-1v () code ! kde ! org
[Download RAW message or body]

Git commit cb81ef8f69f6a48ed505f5aef50c62a10aa67283 by Christian Mollekopf.
Committed on 26/06/2016 at 12:23.
Pushed by cmollekopf into branch 'develop'.

Remove the store from the resource side.

...and shutdown the resource after we removed all data.

M  +3    -2    common/listener.cpp
M  +0    -6    examples/imapresource/tests/imapmailtest.cpp
M  +0    -6    examples/maildirresource/tests/maildirmailtest.cpp
M  +1    -2    tests/mailtest.cpp
M  +0    -1    tests/mailtest.h

http://commits.kde.org/akonadi-next/cb81ef8f69f6a48ed505f5aef50c62a10aa67283

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 <QtTest>
 
 #include <tests/mailtest.h>
-#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 <QtTest>
 
 #include <tests/mailtest.h>
-#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();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic