Skip to content
Snippets Groups Projects
Commit 72f36803 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

+ asserts

parent 8adc4058
No related branches found
No related tags found
1 merge request!2667simplify Jobpar view update; fix crash upon reloading project (#1006)
...@@ -50,12 +50,14 @@ void JobMessagesDisplay::setJobItem(JobItem* jobItem) ...@@ -50,12 +50,14 @@ void JobMessagesDisplay::setJobItem(JobItem* jobItem)
const bool ok = isFailed(m_job_item->batchInfo()->status()); const bool ok = isFailed(m_job_item->batchInfo()->status());
m_comments_editor->setTextColor(ok ? Qt::black : Qt::red); m_comments_editor->setTextColor(ok ? Qt::black : Qt::red);
connect(m_job_item->batchInfo(), &BatchInfo::jobCommentsChanged, [this](const QString&) { connect(m_job_item->batchInfo(), &BatchInfo::jobCommentsChanged, [this](const QString&) {
if (m_job_item if (!m_job_item)
&& m_job_item->batchInfo()->comments() != m_comments_editor->toPlainText()) { return;
m_comments_editor->blockSignals(true); ASSERT(m_job_item->batchInfo());
m_comments_editor->setPlainText(m_job_item->batchInfo()->comments()); if (m_job_item->batchInfo()->comments() == m_comments_editor->toPlainText())
m_comments_editor->blockSignals(false); return;
} m_comments_editor->blockSignals(true);
m_comments_editor->setPlainText(m_job_item->batchInfo()->comments());
m_comments_editor->blockSignals(false);
}); });
} else } else
m_comments_editor->clear(); m_comments_editor->clear();
...@@ -65,6 +67,7 @@ void JobMessagesDisplay::onCommentsEdited() ...@@ -65,6 +67,7 @@ void JobMessagesDisplay::onCommentsEdited()
{ {
if (m_job_item) { if (m_job_item) {
m_job_item->blockSignals(true); m_job_item->blockSignals(true);
ASSERT(m_job_item->batchInfo());
m_job_item->batchInfo()->setComments(m_comments_editor->toPlainText()); m_job_item->batchInfo()->setComments(m_comments_editor->toPlainText());
m_job_item->blockSignals(false); m_job_item->blockSignals(false);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment