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
@@ -4,6 +4,7 @@
#include <sstream>
#include <iomanip>
#include "data/ErrorCountInfo.h"
#include "utility/messaging/Message.h"
#include "utility/messaging/type/MessageStatus.h"
@@ -11,7 +12,7 @@ class MessageFinishedParsing
: public Message<MessageFinishedParsing>
{
public:
MessageFinishedParsing(size_t fileCount, size_t totalFileCount, float parseTime, size_t errorCount)
MessageFinishedParsing(size_t fileCount, size_t totalFileCount, float parseTime, ErrorCountInfo errorCount)
: fileCount(fileCount)
, totalFileCount(totalFileCount)
, parseTime(parseTime)
@@ -26,7 +27,7 @@ public:
virtual void dispatch()
{
MessageStatus(getStatusStr(), errorCount > 0).dispatch();
MessageStatus(getStatusStr(), errorCount.total > 0).dispatch();
Message<MessageFinishedParsing>::dispatch();
}
@@ -37,7 +38,11 @@ public:
ss << "Finished analysis: ";
ss << fileCount << "/" << totalFileCount << " files, ";
ss << std::setprecision(2) << std::fixed << parseTime << " seconds, ";
ss << errorCount << " error(s)";
ss << errorCount.total << " error" << (errorCount.total > 1 ? "s" : "");
if (errorCount.fatal > 0)
{
ss << " (" << errorCount.fatal << " fatal)";
}
return ss.str();
}
@@ -49,7 +54,7 @@ public:
size_t fileCount;
size_t totalFileCount;
float parseTime;
size_t errorCount;
ErrorCountInfo errorCount;
};
#endif // MESSAGE_FINISHED_PARSING_H
@@ -1,13 +1,14 @@
#ifndef MESSAGE_SHOW_ERRORS_H
#define MESSAGE_SHOW_ERRORS_H
#include "data/ErrorCountInfo.h"
#include "utility/messaging/Message.h"
class MessageShowErrors
: public Message<MessageShowErrors>
{
public:
MessageShowErrors(int errorCount)
MessageShowErrors(ErrorCountInfo errorCount)
: errorCount(errorCount)
{
}
@@ -17,7 +18,7 @@ public:
return "MessageShowErrors";
}
int errorCount;
ErrorCountInfo errorCount;
};
#endif // MESSAGE_SHOW_ERRORS_H