data: explicitly clear all errors when refreshing incomplete files

This commit is contained in:
Eberhard Graether
2018-06-11 15:55:23 +02:00
parent 1a37a9af34
commit 1c9b4c1afd
7 changed files with 29 additions and 4 deletions
+8 -2
View File
@@ -8,10 +8,11 @@
#include "Application.h"
TaskCleanStorage::TaskCleanStorage(
PersistentStorage* storage, const std::vector<FilePath>& filePaths
PersistentStorage* storage, const std::vector<FilePath>& filePaths, bool clearAllErrors
)
: m_storage(storage)
, m_filePaths(filePaths)
, m_clearAllErrors(clearAllErrors)
{
}
@@ -22,7 +23,7 @@ void TaskCleanStorage::doEnter(std::shared_ptr<Blackboard> blackboard)
m_start = utility::durationStart();
if (!m_filePaths.empty())
if (!m_filePaths.empty() || m_clearAllErrors)
{
m_storage->setMode(SqliteIndexStorage::STORAGE_MODE_CLEAR);
}
@@ -30,6 +31,11 @@ void TaskCleanStorage::doEnter(std::shared_ptr<Blackboard> blackboard)
Task::TaskState TaskCleanStorage::doUpdate(std::shared_ptr<Blackboard> blackboard)
{
if (m_clearAllErrors)
{
m_storage->clearAllErrors();
}
m_storage->clearFileElements(m_filePaths, [=](int progress)
{
Application::getInstance()->getDialogView()->showProgressDialog(