GUI: Rename methods in CheckStatistics
This commit is contained in:
parent
24ce4292f2
commit
5ed4c7f3ea
|
@ -22,10 +22,10 @@
|
||||||
CheckStatistics::CheckStatistics(QObject *parent)
|
CheckStatistics::CheckStatistics(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
Clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckStatistics::AddItem(ShowTypes::ShowType type)
|
void CheckStatistics::addItem(ShowTypes::ShowType type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ShowTypes::ShowStyle:
|
case ShowTypes::ShowStyle:
|
||||||
|
@ -53,7 +53,7 @@ void CheckStatistics::AddItem(ShowTypes::ShowType type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckStatistics::Clear()
|
void CheckStatistics::clear()
|
||||||
{
|
{
|
||||||
mStyle = 0;
|
mStyle = 0;
|
||||||
mWarning = 0;
|
mWarning = 0;
|
||||||
|
@ -63,7 +63,7 @@ void CheckStatistics::Clear()
|
||||||
mError = 0;
|
mError = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned CheckStatistics::GetCount(ShowTypes::ShowType type) const
|
unsigned CheckStatistics::getCount(ShowTypes::ShowType type) const
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ShowTypes::ShowStyle:
|
case ShowTypes::ShowStyle:
|
||||||
|
|
|
@ -37,13 +37,13 @@ public:
|
||||||
*
|
*
|
||||||
* @param type Type of the item to add.
|
* @param type Type of the item to add.
|
||||||
*/
|
*/
|
||||||
void AddItem(ShowTypes::ShowType type);
|
void addItem(ShowTypes::ShowType type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Clear the statistics.
|
* @brief Clear the statistics.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Clear();
|
void clear();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return statistics for given type.
|
* @brief Return statistics for given type.
|
||||||
|
@ -51,7 +51,7 @@ public:
|
||||||
* @param type Type for which the statistics are returned.
|
* @param type Type for which the statistics are returned.
|
||||||
* @return Number of items of given type.
|
* @return Number of items of given type.
|
||||||
*/
|
*/
|
||||||
unsigned GetCount(ShowTypes::ShowType type) const;
|
unsigned getCount(ShowTypes::ShowType type) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned mStyle;
|
unsigned mStyle;
|
||||||
|
|
|
@ -78,7 +78,7 @@ void ResultsView::Clear(bool results)
|
||||||
|
|
||||||
mUI.mDetails->setText("");
|
mUI.mDetails->setText("");
|
||||||
|
|
||||||
mStatistics->Clear();
|
mStatistics->clear();
|
||||||
|
|
||||||
//Clear the progressbar
|
//Clear the progressbar
|
||||||
mUI.mProgress->setMaximum(PROGRESS_MAX);
|
mUI.mProgress->setMaximum(PROGRESS_MAX);
|
||||||
|
@ -106,7 +106,7 @@ void ResultsView::Error(const ErrorItem &item)
|
||||||
{
|
{
|
||||||
if (mUI.mTree->AddErrorItem(item)) {
|
if (mUI.mTree->AddErrorItem(item)) {
|
||||||
emit GotResults();
|
emit GotResults();
|
||||||
mStatistics->AddItem(ShowTypes::SeverityToShowType(item.severity));
|
mStatistics->addItem(ShowTypes::SeverityToShowType(item.severity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,17 +107,17 @@ void StatsDialog::PDFexport()
|
||||||
.arg(tr("Statistics"))
|
.arg(tr("Statistics"))
|
||||||
.arg(QDate::currentDate().toString("dd.MM.yyyy"))
|
.arg(QDate::currentDate().toString("dd.MM.yyyy"))
|
||||||
.arg(tr("Errors"))
|
.arg(tr("Errors"))
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowErrors))
|
.arg(mStatistics->getCount(ShowTypes::ShowErrors))
|
||||||
.arg(tr("Warnings"))
|
.arg(tr("Warnings"))
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowWarnings))
|
.arg(mStatistics->getCount(ShowTypes::ShowWarnings))
|
||||||
.arg(tr("Style warnings"))
|
.arg(tr("Style warnings"))
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowStyle))
|
.arg(mStatistics->getCount(ShowTypes::ShowStyle))
|
||||||
.arg(tr("Portability warnings"))
|
.arg(tr("Portability warnings"))
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowPortability))
|
.arg(mStatistics->getCount(ShowTypes::ShowPortability))
|
||||||
.arg(tr("Performance warnings"))
|
.arg(tr("Performance warnings"))
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowPerformance))
|
.arg(mStatistics->getCount(ShowTypes::ShowPerformance))
|
||||||
.arg(tr("Information messages"))
|
.arg(tr("Information messages"))
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowInformation));
|
.arg(mStatistics->getCount(ShowTypes::ShowInformation));
|
||||||
|
|
||||||
QString fileName = QFileDialog::getSaveFileName((QWidget*)0, tr("Export PDF"), QString(), "*.pdf");
|
QString fileName = QFileDialog::getSaveFileName((QWidget*)0, tr("Export PDF"), QString(), "*.pdf");
|
||||||
if (QFileInfo(fileName).suffix().isEmpty()) {
|
if (QFileInfo(fileName).suffix().isEmpty()) {
|
||||||
|
@ -199,17 +199,17 @@ void StatsDialog::copyToClipboard()
|
||||||
)
|
)
|
||||||
.arg(stats)
|
.arg(stats)
|
||||||
.arg(errors)
|
.arg(errors)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowErrors))
|
.arg(mStatistics->getCount(ShowTypes::ShowErrors))
|
||||||
.arg(warnings)
|
.arg(warnings)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowWarnings))
|
.arg(mStatistics->getCount(ShowTypes::ShowWarnings))
|
||||||
.arg(style)
|
.arg(style)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowStyle))
|
.arg(mStatistics->getCount(ShowTypes::ShowStyle))
|
||||||
.arg(portability)
|
.arg(portability)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowPortability))
|
.arg(mStatistics->getCount(ShowTypes::ShowPortability))
|
||||||
.arg(performance)
|
.arg(performance)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowPerformance))
|
.arg(mStatistics->getCount(ShowTypes::ShowPerformance))
|
||||||
.arg(information)
|
.arg(information)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowInformation));
|
.arg(mStatistics->getCount(ShowTypes::ShowInformation));
|
||||||
|
|
||||||
const QString textSummary = settings + previous + statistics;
|
const QString textSummary = settings + previous + statistics;
|
||||||
|
|
||||||
|
@ -261,17 +261,17 @@ void StatsDialog::copyToClipboard()
|
||||||
)
|
)
|
||||||
.arg(stats)
|
.arg(stats)
|
||||||
.arg(errors)
|
.arg(errors)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowErrors))
|
.arg(mStatistics->getCount(ShowTypes::ShowErrors))
|
||||||
.arg(warnings)
|
.arg(warnings)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowWarnings))
|
.arg(mStatistics->getCount(ShowTypes::ShowWarnings))
|
||||||
.arg(style)
|
.arg(style)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowStyle))
|
.arg(mStatistics->getCount(ShowTypes::ShowStyle))
|
||||||
.arg(portability)
|
.arg(portability)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowPortability))
|
.arg(mStatistics->getCount(ShowTypes::ShowPortability))
|
||||||
.arg(performance)
|
.arg(performance)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowPerformance))
|
.arg(mStatistics->getCount(ShowTypes::ShowPerformance))
|
||||||
.arg(information)
|
.arg(information)
|
||||||
.arg(mStatistics->GetCount(ShowTypes::ShowInformation));
|
.arg(mStatistics->getCount(ShowTypes::ShowInformation));
|
||||||
|
|
||||||
const QString htmlSummary = htmlSettings + htmlPrevious + htmlStatistics;
|
const QString htmlSummary = htmlSettings + htmlPrevious + htmlStatistics;
|
||||||
|
|
||||||
|
@ -285,10 +285,10 @@ void StatsDialog::copyToClipboard()
|
||||||
void StatsDialog::setStatistics(const CheckStatistics *stats)
|
void StatsDialog::setStatistics(const CheckStatistics *stats)
|
||||||
{
|
{
|
||||||
mStatistics = const_cast<CheckStatistics*>(stats);
|
mStatistics = const_cast<CheckStatistics*>(stats);
|
||||||
mUI.mLblErrors->setText(QString("%1").arg(stats->GetCount(ShowTypes::ShowErrors)));
|
mUI.mLblErrors->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowErrors)));
|
||||||
mUI.mLblWarnings->setText(QString("%1").arg(stats->GetCount(ShowTypes::ShowWarnings)));
|
mUI.mLblWarnings->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowWarnings)));
|
||||||
mUI.mLblStyle->setText(QString("%1").arg(stats->GetCount(ShowTypes::ShowStyle)));
|
mUI.mLblStyle->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowStyle)));
|
||||||
mUI.mLblPortability->setText(QString("%1").arg(stats->GetCount(ShowTypes::ShowPortability)));
|
mUI.mLblPortability->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowPortability)));
|
||||||
mUI.mLblPerformance->setText(QString("%1").arg(stats->GetCount(ShowTypes::ShowPerformance)));
|
mUI.mLblPerformance->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowPerformance)));
|
||||||
mUI.mLblInformation->setText(QString("%1").arg(stats->GetCount(ShowTypes::ShowInformation)));
|
mUI.mLblInformation->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowInformation)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue