This change passes all file node ids for clearing to the sqlite storage at once and makes use of ON DELETE CASCADE for everything else, instead of manally deleting all source locations.
37 lines
610 B
C++
37 lines
610 B
C++
#ifndef TASK_CLEAN_STORAGE_H
|
|
#define TASK_CLEAN_STORAGE_H
|
|
|
|
#include <vector>
|
|
|
|
#include "utility/file/FilePath.h"
|
|
#include "utility/scheduling/Task.h"
|
|
#include "utility/utility.h"
|
|
|
|
class Storage;
|
|
|
|
class TaskCleanStorage
|
|
: public Task
|
|
{
|
|
public:
|
|
TaskCleanStorage(
|
|
Storage* storage,
|
|
const std::vector<FilePath>& filePaths
|
|
);
|
|
|
|
virtual void enter();
|
|
virtual TaskState update();
|
|
virtual void exit();
|
|
|
|
virtual void interrupt();
|
|
virtual void revert();
|
|
|
|
private:
|
|
Storage* m_storage;
|
|
std::vector<FilePath> m_filePaths;
|
|
const size_t m_fileCount;
|
|
|
|
utility::TimePoint m_start;
|
|
};
|
|
|
|
#endif // TASK_PARSE_CXX_H
|