logic: Fixed refreshing when source paths were removed

* Define exit state for TaskRepeatWhileSuccess
* Added TaskFinishParsing to end of parsing task sequence
* Also measure time spend clearing files in total index time
This commit is contained in:
Eberhard Graether
2016-09-29 14:58:45 +02:00
parent e5cd905670
commit 3dffd55f75
15 changed files with 202 additions and 80 deletions
+2 -25
View File
@@ -1,19 +1,15 @@
#include "data/parser/TaskParseWrapper.h"
#include "component/view/DialogView.h"
#include "data/PersistentStorage.h"
#include "utility/file/FileRegister.h"
#include "utility/messaging/type/MessageFinishedParsing.h"
#include "utility/scheduling/Blackboard.h"
#include "utility/utility.h"
TaskParseWrapper::TaskParseWrapper(
PersistentStorage* storage,
std::shared_ptr<FileRegister> fileRegister,
DialogView* dialogView
)
: m_storage(storage)
, m_fileRegister(fileRegister)
: m_fileRegister(fileRegister)
, m_dialogView(dialogView)
{
}
@@ -36,7 +32,6 @@ void TaskParseWrapper::doEnter(std::shared_ptr<Blackboard> blackboard)
m_dialogView->updateIndexingDialog(0, m_fileRegister->getSourceFilesCount(), "");
m_start = utility::durationStart();
m_storage->startParsing();
}
Task::TaskState TaskParseWrapper::doUpdate(std::shared_ptr<Blackboard> blackboard)
@@ -47,25 +42,7 @@ Task::TaskState TaskParseWrapper::doUpdate(std::shared_ptr<Blackboard> blackboar
void TaskParseWrapper::doExit(std::shared_ptr<Blackboard> blackboard)
{
blackboard->clear("indexer_count");
m_dialogView->showProgressDialog("Finish Indexing", "Optimizing database");
m_storage->optimizeMemory();
m_dialogView->showProgressDialog("Finish Indexing", "Building caches");
m_storage->finishParsing();
m_dialogView->hideProgressDialog();
MessageFinishedParsing().dispatch();
m_dialogView->finishedIndexingDialog(
m_fileRegister->getParsedSourceFilesCount(),
m_fileRegister->getSourceFilesCount(),
utility::duration(m_start),
m_storage->getErrorCount()
);
blackboard->set("index_time", utility::duration(m_start));
}
void TaskParseWrapper::doReset(std::shared_ptr<Blackboard> blackboard)