From af84fb65982a6e9cb3c994c608acc0103ebc8e4c Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Wed, 20 Nov 2019 10:45:44 +1300 Subject: [PATCH] Simulation Experiment view: fixed a small issue with the tracking of the end of a simulation. If we were to run several simulations at the same time, we might have ended up with one of them having its progress updated *after* the simulation finished. --- .../src/simulationexperimentviewsimulationwidget.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp index 912abfe263..8224f25599 100644 --- a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp +++ b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewsimulationwidget.cpp @@ -897,7 +897,7 @@ void SimulationExperimentViewSimulationWidget::initialize(bool pReloadingView) // Reset our progress - mProgress = -1; + mProgress = 0; // Clean up our output, if needed @@ -3568,14 +3568,6 @@ void SimulationExperimentViewSimulationWidget::simulationDone(qint64 pElapsedTim // Stop keeping track of our simulation progress mProgress = -1; - - // Note: our simulation progress gets reset in resetSimulationProgress(), - // which is called by - // SimulationExperimentViewWidget::checkSimulationResults(). To reset - // our simulation progress here might not always work since our - // simulation is run in a different thread, meaning that a call to - // updateSimulationResults() might occur after we have reset our - // simulation progress... } //============================================================================== @@ -4316,7 +4308,7 @@ void SimulationExperimentViewSimulationWidget::updateSimulationResults(Simulatio // Note: tabBarPixmapSize()-2 because we want a one-pixel wide // border... - if (newProgress != mProgress) { + if ((newProgress != mProgress) && (mProgress != -1)) { // The progress has changed, so keep track of its new value and // update our file tab icon