fix: no dialogs in headless mode
This commit is contained in:
@@ -31,13 +31,22 @@ Task::TaskState TaskFinishParsing::doUpdate(std::shared_ptr<Blackboard> blackboa
|
||||
{
|
||||
TimePoint start = utility::durationStart();
|
||||
|
||||
m_dialogView->showStatusDialog("Finish Indexing", "Optimizing database");
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->showStatusDialog("Finish Indexing", "Optimizing database");
|
||||
}
|
||||
m_storage->optimizeMemory();
|
||||
|
||||
m_dialogView->showStatusDialog("Finish Indexing", "Building caches");
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->showStatusDialog("Finish Indexing", "Building caches");
|
||||
}
|
||||
m_storage->buildCaches();
|
||||
|
||||
m_dialogView->hideStatusDialog();
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->hideStatusDialog();
|
||||
}
|
||||
MessageFinishedParsing().dispatch();
|
||||
|
||||
float time = utility::duration(start);
|
||||
@@ -62,12 +71,15 @@ Task::TaskState TaskFinishParsing::doUpdate(std::shared_ptr<Blackboard> blackboa
|
||||
int sourceFileCount = 0;
|
||||
blackboard->get("source_file_count", sourceFileCount);
|
||||
|
||||
m_dialogView->finishedIndexingDialog(
|
||||
indexedSourceFileCount,
|
||||
sourceFileCount,
|
||||
time,
|
||||
m_storageAccess->getErrorCount()
|
||||
);
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->finishedIndexingDialog(
|
||||
indexedSourceFileCount,
|
||||
sourceFileCount,
|
||||
time,
|
||||
m_storageAccess->getErrorCount()
|
||||
);
|
||||
}
|
||||
|
||||
return STATE_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,10 @@ void TaskShowStatusDialog::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
|
||||
Task::TaskState TaskShowStatusDialog::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
m_dialogView->showStatusDialog(m_title, m_message);
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->showStatusDialog(m_title, m_message);
|
||||
}
|
||||
return STATE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,9 +57,12 @@ Task::TaskState TaskBuildIndex::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
int indexedSourceFileCount = 0;
|
||||
blackboard->get("indexed_source_file_count", indexedSourceFileCount);
|
||||
|
||||
m_dialogView->updateIndexingDialog(
|
||||
indexedSourceFileCount, sourceFileCount, indexerCommand->getSourceFilePath().str()
|
||||
);
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->updateIndexingDialog(
|
||||
indexedSourceFileCount, sourceFileCount, indexerCommand->getSourceFilePath().str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// file register only copies the DileRegisterStateData
|
||||
|
||||
@@ -30,7 +30,10 @@ void TaskParseWrapper::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
int sourceFileCount = 0;
|
||||
blackboard->get("source_file_count", sourceFileCount);
|
||||
m_dialogView->updateIndexingDialog(0, sourceFileCount, "");
|
||||
if (m_dialogView)
|
||||
{
|
||||
m_dialogView->updateIndexingDialog(0, sourceFileCount, "");
|
||||
}
|
||||
|
||||
m_start = utility::durationStart();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user