fix: no dialogs in headless mode

This commit is contained in:
Andreas Stallinger
2017-03-14 18:22:46 +01:00
parent a8edf47685
commit c8404aa83d
5 changed files with 74 additions and 36 deletions
+21 -9
View File
@@ -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;
}