Commit 5c5b1ca2 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] Ignore stopped job in job aggregator

Otherwise a finished job in notification history will cause an
indefinite "100%" job.


(cherry picked from commit 4989651e)
parent b37f46d5
Pipeline #205063 failed with stage
in 37 seconds
......@@ -43,7 +43,8 @@ void JobAggregator::setSourceModel(QAbstractItemModel *sourceModel)
Q_UNUSED(bottomRight);
if (roles.isEmpty() || roles.contains(NotificationManager::Notifications::SummaryRole)
|| roles.contains(NotificationManager::Notifications::PercentageRole)) {
|| roles.contains(NotificationManager::Notifications::PercentageRole)
|| roles.contains(NotificationManager::Notifications::JobStateRole)) {
update();
}
});
......@@ -81,6 +82,11 @@ void JobAggregator::update()
for (int i = 0; i < m_model->rowCount(); ++i) {
const QModelIndex idx = m_model->index(i, 0);
if (idx.data(NotificationManager::Notifications::JobStateRole).toInt() == NotificationManager::Notifications::JobStateStopped
|| idx.data(NotificationManager::Notifications::TypeRole).toInt() != NotificationManager::Notifications::JobType) {
continue;
}
const QString summary = idx.data(NotificationManager::Notifications::SummaryRole).toString();
// Include summary only if it's the same for all jobs
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment