logic: Fixed issues when indexing via CLI (issue #718)

* show proper error message in console when project configuration has issues
* quit when project configuration is wrong
* show indexing progress as self-updating percentage
This commit is contained in:
Eberhard Graether
2019-08-26 16:34:54 +02:00
parent 5a97c88a69
commit 733ef0ea04
8 changed files with 43 additions and 57 deletions
@@ -19,18 +19,10 @@ bool SourceGroupCxxCodeblocks::prepareIndexing()
FilePath codeblocksProjectPath = m_settings->getCodeblocksProjectPathExpandedAndAbsolute();
if (!codeblocksProjectPath.empty() && !codeblocksProjectPath.exists())
{
MessageStatus(L"Can't refresh project").dispatch();
if (std::shared_ptr<Application> application = Application::getInstance())
{
if (application->hasGUI())
{
application->handleDialog(
L"Can't refresh. The referenced Code::Blocks project does not exist anymore: " + codeblocksProjectPath.wstr(),
{ L"Ok" }
);
}
}
std::wstring error = L"Can't refresh project. The referenced Code::Blocks project does not exist anymore: " +
codeblocksProjectPath.wstr();
MessageStatus(error, true).dispatch();
Application::getInstance()->handleDialog(error, { L"Ok" });
return false;
}
return true;