Fix issue detected by Coverity, StatsDialog::mStatistics was not initialized in the constructor

This commit is contained in:
Daniel Marjamäki 2017-08-02 08:45:17 +02:00
parent f7514fcd2c
commit ecc84ee027
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,8 @@
#include "checkstatistics.h"
StatsDialog::StatsDialog(QWidget *parent)
: QDialog(parent)
: QDialog(parent),
mStatistics(nullptr)
{
mUI.setupUi(this);
@ -281,7 +282,7 @@ void StatsDialog::copyToClipboard()
void StatsDialog::setStatistics(const CheckStatistics *stats)
{
mStatistics = const_cast<CheckStatistics*>(stats);
mStatistics = stats;
mUI.mLblErrors->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowErrors)));
mUI.mLblWarnings->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowWarnings)));
mUI.mLblStyle->setText(QString("%1").arg(stats->getCount(ShowTypes::ShowStyle)));

View File

@ -68,7 +68,7 @@ private slots:
private:
Ui::StatsDialog mUI;
CheckStatistics *mStatistics;
const CheckStatistics *mStatistics;
};
/// @}