ui: added info screen for indexer crash investigation

* in case Coati crashes while indexing this screen will inform the user of further steps to take in order to find out what happened
This commit is contained in:
malte_langkabel
2016-11-21 12:36:42 +01:00
parent 6b1e3c6b7f
commit 9084d3bd7c
13 changed files with 204 additions and 66 deletions
+12 -27
View File
@@ -17,38 +17,23 @@ TaskParseJava::TaskParseJava(
{
}
Task::TaskState TaskParseJava::doUpdate(std::shared_ptr<Blackboard> blackboard)
void TaskParseJava::indexFile(FilePath sourcePath)
{
std::shared_ptr<ParserClientImpl> parserClient = std::make_shared<ParserClientImpl>();
std::shared_ptr<JavaParser> parser = std::make_shared<JavaParser>(parserClient.get());
FilePath sourcePath = m_fileRegister->consumeSourceFile();
std::shared_ptr<IntermediateStorage> storage = m_storageProvider->popIndexerTarget();
parserClient->setStorage(storage);
parserClient->startParsingFile();
if (sourcePath.empty())
parser->parseFile(sourcePath, TextAccess::createFromFile(sourcePath.str()), m_arguments);
parserClient->finishParsingFile();
parserClient->resetStorage();
if (!m_interrupted)
{
return STATE_FAILURE;
m_fileRegister->markThreadFilesParsed(); // todo: rename to markThreadFilesProcessed
m_storageProvider->pushIndexerTarget(storage);
}
else
{
m_dialogView->updateIndexingDialog(
m_fileRegister->getParsedSourceFilesCount(), m_fileRegister->getSourceFilesCount(), sourcePath.str()
);
std::shared_ptr<IntermediateStorage> storage = m_storageProvider->popIndexerTarget();
parserClient->setStorage(storage);
parserClient->startParsingFile();
parser->parseFile(sourcePath, TextAccess::createFromFile(sourcePath.str()), m_arguments);
parserClient->finishParsingFile();
parserClient->resetStorage();
if (!m_interrupted)
{
m_fileRegister->markThreadFilesParsed(); // todo: rename to markThreadFilesProcessed
m_storageProvider->pushIndexerTarget(storage);
}
}
return (m_interrupted ? STATE_FAILURE : STATE_SUCCESS);
}
@@ -15,7 +15,7 @@ public:
);
private:
virtual TaskState doUpdate(std::shared_ptr<Blackboard> blackboard);
void indexFile(FilePath sourcePath);
};
#endif // TASK_PARSE_JAVA_H