diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h index 1e66e2709102fdbc916a01e87b2635de00316105..3e00a95603c29b4c6bdfa3924a3763bb2703f896 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/Load.h @@ -101,8 +101,6 @@ namespace Mantid API::IAlgorithm_sptr m_loader; /// The name of the property that will be passed the property from our Filename std::string m_filenamePropName; - /// Indicate whether a collection of files should be loaded into a single workspace. - bool m_loadMultipleAsOne; /// Mutex for temporary fix for #5963 static Poco::Mutex m_mutex; }; diff --git a/Code/Mantid/Framework/DataHandling/src/Load.cpp b/Code/Mantid/Framework/DataHandling/src/Load.cpp index 1d701bebd5fb2469758e3bc3fea3c7bbafb2dfec..3e9be99234919b47dbbe9671a253d7d65d5961e4 100644 --- a/Code/Mantid/Framework/DataHandling/src/Load.cpp +++ b/Code/Mantid/Framework/DataHandling/src/Load.cpp @@ -170,24 +170,12 @@ namespace Mantid // ... store it's name and version and check that all other files have loaders with the same name and version. std::string name = loader->name(); int version = loader->version(); - std::string ext = fileNames[0].substr(fileNames[0].find_last_of(".")); for(size_t i = 1; i < fileNames.size(); ++i) { - // If it's loading into a single file, perform a cursory check on file extensions only. - if(dynamic_cast<MultipleFileProperty*>(loader->getPointerToProperty("Filename")) != NULL) - { - if( fileNames[i].substr(fileNames[i].find_last_of(".")) != ext) - { - throw std::runtime_error("Cannot load multiple files when more than one Loader is needed."); - } - } - else - { - loader = getFileLoader(fileNames[i]); - - if( name != loader->name() || version != loader->version() ) - throw std::runtime_error("Cannot load multiple files when more than one Loader is needed."); - } + loader = getFileLoader(fileNames[i]); + + if( name != loader->name() || version != loader->version() ) + throw std::runtime_error("Cannot load multiple files when more than one Loader is needed."); } } @@ -237,18 +225,11 @@ namespace Mantid const auto & props = loader->getProperties(); for(auto it = props.begin(); it != props.end(); ++it) { - auto *fp = dynamic_cast<API::MultipleFileProperty*>(*it); - auto *fp2 = dynamic_cast<API::FileProperty*>(*it); - if(fp) + if(auto *fp = dynamic_cast<API::FileProperty*>(*it)) { m_filenamePropName = fp->name(); break; } - if(fp2) - { - m_filenamePropName = fp2->name(); - break; - } } if(m_filenamePropName.empty()) { @@ -315,7 +296,6 @@ namespace Mantid exts.push_back(".h5"); exts.push_back(".hd5"); exts.push_back(".sqw"); - exts.push_back(".fits"); declareProperty(new MultipleFileProperty("Filename", exts), "The name of the file(s) to read, including the full or relative " @@ -343,15 +323,11 @@ namespace Mantid * Executes the algorithm. */ void Load::exec() - { + { std::vector<std::vector<std::string> > fileNames = getProperty("Filename"); - // Test for loading as a single file - IAlgorithm_sptr loader = getFileLoader(fileNames[0][0]); - m_loadMultipleAsOne = dynamic_cast<MultipleFileProperty*>(loader->getPointerToProperty("Filename")) != NULL; - - if(isSingleFile(fileNames) || m_loadMultipleAsOne) - { + if(isSingleFile(fileNames)) + { // This is essentially just the same code that was called before multiple files were supported. loadSingleFile(); } @@ -363,7 +339,7 @@ namespace Mantid } void Load::loadSingleFile() - { + { std::string loaderName = getPropertyValue("LoaderName"); if( loaderName.empty() ) {