Skip to content
Snippets Groups Projects
Commit ba0e22d4 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

make job connections unique

parent 3b7d6329
No related branches found
No related tags found
1 merge request!2761Fix serialization and plotting jobs without loaded data
......@@ -147,8 +147,9 @@ void JobsSet::runJob(JobItem* job_item)
if (job_item->thread())
throw std::runtime_error("Job already running");
connect(job_item, &JobItem::progressIncremented, this, &JobsSet::onProgressUpdate);
connect(job_item, &JobItem::jobFinished, this, &JobsSet::onFinishedJob);
connect(job_item, &JobItem::progressIncremented, this, &JobsSet::onProgressUpdate,
Qt::UniqueConnection);
connect(job_item, &JobItem::jobFinished, this, &JobsSet::onFinishedJob, Qt::UniqueConnection);
job_item->initWorker();
auto* thread = job_item->thread();
......@@ -164,6 +165,7 @@ void JobsSet::onFinishedJob(JobItem* job_item)
{
onProgressUpdate();
emit newJobFinished(job_item);
qInfo() << "jobMeritsAttention: onFinishedJob";
emit jobMeritsAttention(job_item);
}
......
......@@ -124,6 +124,7 @@ Data2DItem* Plot2DFrame::data2DItem()
void Plot2DFrame::updateFrame()
{
qInfo() << "updateFrame()";
if (!data2DItem()) {
hide();
return;
......
......@@ -142,8 +142,10 @@ void JobsListing::onItemSelectionChanged()
emit selectedJobsChanged(selectedJobItems());
// to update the content of data-showing widget
if (selectedJobItems().size() == 1)
if (selectedJobItems().size() == 1) {
qInfo() << "jobMeritsAttention: onItemSelectionChanged";
emit gDoc->jobs()->jobMeritsAttention(selectedJobItems().front());
}
}
void JobsListing::onJobsDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
......
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