Files
Sourcetrail/src/lib/data/parser/TaskParseWrapper.cpp
T
malte_langkabel 2b24b88745 data: bookmark refactoring
* implemented handling of aggregations in bookmarks
* split index Storage and bookmark storage
* each sqlite database has its own version now
* added bookmark tests
* fixed creating bookmark tables when project can be loaded but bookmark db does not exist
* fixed font size for bookmarkview tooltips
* using bookmark cache now
* using default category name when none specified by the user
* raising bookmark windows when they should be shown
* clearing a bookmark or category in the editor will now update the star icon accordingly
* non-persistent bookmarks use ids of nodes and edges now (instead of names)
* git ignore .srctrlbm files
2017-04-17 10:55:59 +02:00

62 lines
1.3 KiB
C++

#include "data/parser/TaskParseWrapper.h"
#include "component/view/DialogView.h"
#include "data/PersistentStorage.h"
#include "utility/scheduling/Blackboard.h"
#include "utility/utility.h"
#include "Application.h"
TaskParseWrapper::TaskParseWrapper(PersistentStorage* storage)
: m_storage(storage)
{
}
TaskParseWrapper::~TaskParseWrapper()
{
}
void TaskParseWrapper::setTask(std::shared_ptr<Task> task)
{
if (task)
{
m_taskRunner = std::make_shared<TaskRunner>(task);
}
}
void TaskParseWrapper::doEnter(std::shared_ptr<Blackboard> blackboard)
{
int sourceFileCount = 0;
blackboard->get("source_file_count", sourceFileCount);
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
{
dialogView->updateIndexingDialog(0, sourceFileCount, "");
}
m_start = utility::durationStart();
if (sourceFileCount > 0)
{
m_storage->setMode(SqliteIndexStorage::STORAGE_MODE_WRITE);
}
}
Task::TaskState TaskParseWrapper::doUpdate(std::shared_ptr<Blackboard> blackboard)
{
return m_taskRunner->update(blackboard);
}
void TaskParseWrapper::doExit(std::shared_ptr<Blackboard> blackboard)
{
blackboard->set("index_time", utility::duration(m_start));
}
void TaskParseWrapper::doReset(std::shared_ptr<Blackboard> blackboard)
{
m_taskRunner->reset();
}
void TaskParseWrapper::doTerminate()
{
m_taskRunner->terminate();
}