ui: display fatal errors

* added ErrorCountInfo to incorporate reporting of fatal errors during code analysis.
This commit is contained in:
malte_langkabel
2016-03-02 10:53:04 +01:00
parent 4425b39ea1
commit 2ebfbbf88e
21 changed files with 105 additions and 213 deletions
+7 -7
View File
@@ -188,20 +188,20 @@ void Storage::finishParsingFile(const FilePath& filePath)
m_sqliteStorage.commitTransaction();
}
void Storage::onError(const ParseLocation& location, const std::string& message)
void Storage::onError(const ParseLocation& location, const std::string& message, bool fatal)
{
log("ERROR", message, location);
log(std::string(fatal ? "FATAL " : "") + "ERROR", message, location);
if (!location.isValid())
{
return;
}
size_t errorCount = getErrorCount();
size_t totalErrorCount = getErrorCount().total;
m_sqliteStorage.addError(message, location.filePath.str(), location.startLineNumber, location.startColumnNumber);
m_sqliteStorage.addError(message, fatal, location.filePath.str(), location.startLineNumber, location.startColumnNumber);
if (errorCount != getErrorCount())
if (totalErrorCount != getErrorCount().total)
{
MessageShowErrors msg(getErrorCount());
msg.setSendAsTask(false);
@@ -209,9 +209,9 @@ void Storage::onError(const ParseLocation& location, const std::string& message)
}
}
size_t Storage::getErrorCount() const
ErrorCountInfo Storage::getErrorCount() const
{
return m_sqliteStorage.getAllErrors().size();
return ErrorCountInfo(m_sqliteStorage.getAllErrors().size(), m_sqliteStorage.getFatalErrors().size());
}
Id Storage::onTypedefParsed(