ui: display fatal errors
* added ErrorCountInfo to incorporate reporting of fatal errors during code analysis.
This commit is contained in:
@@ -64,11 +64,13 @@ void QtStatusBar::setText(const std::string& text, bool isError, bool showLoader
|
||||
m_text.setText(text.c_str());
|
||||
}
|
||||
|
||||
void QtStatusBar::setErrorCount(size_t count)
|
||||
void QtStatusBar::setErrorCount(ErrorCountInfo errorCount)
|
||||
{
|
||||
if (count > 0)
|
||||
if (errorCount.total > 0)
|
||||
{
|
||||
m_errorButton.setText(QString::number(count) + " error(s)");
|
||||
m_errorButton.setText(
|
||||
QString::number(errorCount.total) + " error" + (errorCount.total > 1 ? "s" : "") +
|
||||
(errorCount.fatal > 0 ? "(" + QString::number(errorCount.fatal) + " fatal)" : ""));
|
||||
m_errorButton.show();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <QLabel>
|
||||
#include <QStatusBar>
|
||||
|
||||
#include "data/ErrorCountInfo.h"
|
||||
|
||||
class QtStatusBar
|
||||
: public QStatusBar
|
||||
{
|
||||
@@ -17,7 +19,7 @@ public:
|
||||
virtual ~QtStatusBar(void);
|
||||
|
||||
void setText(const std::string& text, bool isError, bool showLoader);
|
||||
void setErrorCount(size_t count);
|
||||
void setErrorCount(ErrorCountInfo errorCount);
|
||||
|
||||
private slots:
|
||||
void showErrors();
|
||||
|
||||
@@ -40,9 +40,9 @@ void QtStatusBarView::showMessage(const std::string& message, bool isError, bool
|
||||
m_showMessageFunctor(message, isError, showLoader);
|
||||
}
|
||||
|
||||
void QtStatusBarView::setErrorCount(size_t count)
|
||||
void QtStatusBarView::setErrorCount(ErrorCountInfo errorCount)
|
||||
{
|
||||
m_setErrorCountFunctor(count);
|
||||
m_setErrorCountFunctor(errorCount);
|
||||
}
|
||||
|
||||
void QtStatusBarView::doShowMessage(const std::string& message, bool isError, bool showLoader)
|
||||
@@ -50,7 +50,7 @@ void QtStatusBarView::doShowMessage(const std::string& message, bool isError, bo
|
||||
m_widget->setText(message, isError, showLoader);
|
||||
}
|
||||
|
||||
void QtStatusBarView::doSetErrorCount(size_t count)
|
||||
void QtStatusBarView::doSetErrorCount(ErrorCountInfo errorCount)
|
||||
{
|
||||
m_widget->setErrorCount(count);
|
||||
m_widget->setErrorCount(errorCount);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "component/view/StatusBarView.h"
|
||||
#include "data/ErrorCountInfo.h"
|
||||
#include "qt/element/QtStatusBar.h"
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
|
||||
@@ -22,14 +23,14 @@ public:
|
||||
|
||||
// StatusBar view implementation
|
||||
virtual void showMessage(const std::string& message, bool isError, bool showLoader);
|
||||
virtual void setErrorCount(size_t count);
|
||||
virtual void setErrorCount(ErrorCountInfo errorCount);
|
||||
|
||||
private:
|
||||
void doShowMessage(const std::string& message, bool isError, bool showLoader);
|
||||
void doSetErrorCount(size_t count);
|
||||
void doSetErrorCount(ErrorCountInfo errorCount);
|
||||
|
||||
QtThreadedFunctor<const std::string&, bool, bool> m_showMessageFunctor;
|
||||
QtThreadedFunctor<size_t> m_setErrorCountFunctor;
|
||||
QtThreadedFunctor<ErrorCountInfo> m_setErrorCountFunctor;
|
||||
|
||||
std::shared_ptr<QtStatusBar> m_widget;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user