diff options
Diffstat (limited to 'common/resourcefacade.cpp')
-rw-r--r-- | common/resourcefacade.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/common/resourcefacade.cpp b/common/resourcefacade.cpp index b3ace94..0bcc6b9 100644 --- a/common/resourcefacade.cpp +++ b/common/resourcefacade.cpp | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "query.h" | 22 | #include "query.h" |
23 | #include "definitions.h" | 23 | #include "definitions.h" |
24 | #include "storage.h" | 24 | #include "storage.h" |
25 | #include "store.h" | ||
25 | #include "resourceaccess.h" | 26 | #include "resourceaccess.h" |
26 | #include <QDir> | 27 | #include <QDir> |
27 | 28 | ||
@@ -247,13 +248,7 @@ ResourceFacade::~ResourceFacade() | |||
247 | KAsync::Job<void> ResourceFacade::remove(const Sink::ApplicationDomain::SinkResource &resource) | 248 | KAsync::Job<void> ResourceFacade::remove(const Sink::ApplicationDomain::SinkResource &resource) |
248 | { | 249 | { |
249 | const auto identifier = resource.identifier(); | 250 | const auto identifier = resource.identifier(); |
250 | return LocalStorageFacade<Sink::ApplicationDomain::SinkResource>::remove(resource).then<void>([identifier]() { | 251 | return Sink::Store::removeDataFromDisk(identifier).then(LocalStorageFacade<Sink::ApplicationDomain::SinkResource>::remove(resource)); |
251 | // TODO shutdown resource, or use the resource process with a --remove option to cleanup (so we can take advantage of the file locking) | ||
252 | QDir dir(Sink::storageLocation()); | ||
253 | for (const auto &folder : dir.entryList(QStringList() << identifier + "*")) { | ||
254 | Sink::Storage(Sink::storageLocation(), folder, Sink::Storage::ReadWrite).removeFromDisk(); | ||
255 | } | ||
256 | }); | ||
257 | } | 252 | } |
258 | 253 | ||
259 | QPair<KAsync::Job<void>, typename Sink::ResultEmitter<typename ApplicationDomain::SinkResource::Ptr>::Ptr> ResourceFacade::load(const Sink::Query &query) | 254 | QPair<KAsync::Job<void>, typename Sink::ResultEmitter<typename ApplicationDomain::SinkResource::Ptr>::Ptr> ResourceFacade::load(const Sink::Query &query) |