Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Aug 25, 2023
1 parent 18d9c2e commit 95f6128
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions gui/resultsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ void ResultsView::clear(bool results)
mUI->mProgress->setFormat("%p%");

mUI->mLabelCriticalErrors->setVisible(false);

mSuccess = false;
}

void ResultsView::clear(const QString &filename)
Expand Down Expand Up @@ -282,6 +284,7 @@ QString ResultsView::getCheckDirectory()

void ResultsView::checkingStarted(int count)
{
mSuccess = true;
mUI->mProgress->setVisible(true);
mUI->mProgress->setMaximum(PROGRESS_MAX);
mUI->mProgress->setValue(0);
Expand All @@ -290,8 +293,6 @@ void ResultsView::checkingStarted(int count)

void ResultsView::checkingFinished()
{
mSuccess = !mUI->mLabelCriticalErrors->isVisible();

mUI->mProgress->setVisible(false);
mUI->mProgress->setFormat("%p%");

Expand Down Expand Up @@ -356,6 +357,8 @@ void ResultsView::disableProgressbar()

void ResultsView::readErrorsXml(const QString &filename)
{
mSuccess = false; // Don't know if results come from an aborted analysis

const int version = XmlReport::determineVersion(filename);
if (version == 0) {
QMessageBox msgBox;
Expand Down Expand Up @@ -517,6 +520,7 @@ void ResultsView::on_mListLog_customContextMenuRequested(const QPoint &pos)

void ResultsView::stopAnalysis()
{
mSuccess = false;
mUI->mLabelCriticalErrors->setText(tr("Analysis was stopped"));
mUI->mLabelCriticalErrors->setVisible(true);
}
Expand All @@ -541,9 +545,10 @@ void ResultsView::handleCriticalError(const ErrorItem &item)
msg += ". " + tr("Analysis was aborted.");
mUI->mLabelCriticalErrors->setText(msg);
mUI->mLabelCriticalErrors->setVisible(true);
mSuccess = false;
}
}

bool ResultsView::isSuccess() const {
return mSuccess && !mUI->mLabelCriticalErrors->isVisible();
return mSuccess;
}
5 changes: 4 additions & 1 deletion gui/resultsview.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,11 @@ public slots:

private:

/**
* If provided ErrorItem is a critical error then display warning message
* in the resultsview
*/
void handleCriticalError(const ErrorItem& item);
bool mHasCriticalError = false;

/**
* @brief Should we show a "No errors found dialog" every time no errors were found?
Expand Down

0 comments on commit 95f6128

Please sign in to comment.