Skip to content

Commit

Permalink
Health check: Show a message if everything is healthy
Browse files Browse the repository at this point in the history
Fixes #551
  • Loading branch information
wolframroesler committed Jan 10, 2020
1 parent d25ecd8 commit 3462fc2
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/gui/reports/ReportsWidgetHealthcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,23 @@ void ReportsWidgetHealthcheck::showEvent(QShowEvent* event)

void ReportsWidgetHealthcheck::calculateHealth()
{
m_referencesModel->clear();

const QScopedPointer<Health> health(AsyncTask::runAndWaitForFuture([this] { return new Health(m_db); }));
if (health->items().empty()) {

m_referencesModel->clear();
m_referencesModel->setHorizontalHeaderLabels(QStringList() << tr("") << tr("Title") << tr("Path") << tr("Reason"));
// No findings
m_referencesModel->clear();
m_referencesModel->setHorizontalHeaderLabels(QStringList() << tr("Congratulations, everything is healthy!"));

m_row2entry.clear();
for (const auto& item : health->items()) {
addHealthRow(item.health, *item.group, *item.entry);
} else {

// Show our findings
m_referencesModel->setHorizontalHeaderLabels(QStringList()
<< tr("") << tr("Title") << tr("Path") << tr("Reason"));
for (const auto& item : health->items()) {
addHealthRow(item.health, *item.group, *item.entry);
}
}

m_ui->healthcheckTableView->resizeRowsToContents();
Expand Down

0 comments on commit 3462fc2

Please sign in to comment.