diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/StepScan.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/StepScan.h index fae81526ed8e..9234e18cbe7e 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/StepScan.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/StepScan.h @@ -69,7 +69,6 @@ private slots: Ui::StepScan m_uiForm; ///< The form generated by Qt Designer std::string m_inputWSName, m_tableWSName, m_plotWSName; QString m_inputFilename; - bool m_dataReloadNeeded; const std::string m_instrument; ///< The default instrument (for live data) API::AlgorithmRunner * m_algRunner; ///< Object for running algorithms asynchronously diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp index d2555813b9bd..b31b7bae3eb5 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp @@ -25,7 +25,7 @@ using namespace Mantid::API; /// Constructor StepScan::StepScan(QWidget *parent) - : UserSubWindow(parent), m_dataReloadNeeded(false), + : UserSubWindow(parent), m_instrument(ConfigService::Instance().getInstrument().name()), m_algRunner(new API::AlgorithmRunner(this)), m_addObserver(*this, &StepScan::handleAddEvent), @@ -169,7 +169,7 @@ void StepScan::loadFile(bool async) const QString filename = m_uiForm.mWRunFiles->getFirstFilename(); // This handles the fact that mwRunFiles emits the filesFound signal more than // we want (on some platforms). TODO: Consider dealing with this up in mwRunFiles. - if ( filename != m_inputFilename || m_dataReloadNeeded ) + if ( filename != m_inputFilename ) { m_inputFilename = filename; @@ -200,7 +200,6 @@ void StepScan::loadFileComplete(bool error) disconnect(m_algRunner, SIGNAL(algorithmComplete(bool)), this, SLOT(loadFileComplete(bool))); if ( ! error ) { - m_dataReloadNeeded = false; setupOptionControls(); } else @@ -355,10 +354,6 @@ IAlgorithm_sptr StepScan::setupStepScanAlg() break; } - // If any of the filtering options were set, next time round we'll need to reload the data - // as they cause the workspace to be changed - if ( !maskWS.isEmpty() || !xminStr.isEmpty() || !xmaxStr.isEmpty() ) m_dataReloadNeeded = true; - return stepScan; } @@ -399,9 +394,11 @@ void StepScan::runStepScanAlg() else // Offline data { // Check just in case the user has deleted the loaded workspace - if ( ! AnalysisDataService::Instance().doesExist(m_inputWSName) ) m_dataReloadNeeded = true; - // Reload also needed if the workspace isn't fresh, as well as if the line above triggers - if ( m_dataReloadNeeded ) loadFile(false); + if ( ! AnalysisDataService::Instance().doesExist(m_inputWSName) ) + { + m_inputFilename.clear(); + loadFile(false); + } stepScan->setPropertyValue("InputWorkspace", m_inputWSName); algSuccessful = stepScan->execute(); }