Skip to content

Commit

Permalink
Fix run files widget to use set property name. Refs #5700
Browse files Browse the repository at this point in the history
It had been accidentally hard coded to use Filename as a property name
when checking if a file is valid for an algorithm.
  • Loading branch information
martyngigg committed Aug 8, 2012
1 parent d6500c2 commit 24a4122
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ void FindFilesThread::getFilesFromAlgorithm()
if(!algorithm) throw std::invalid_argument("Cannot create algorithm " + m_algorithm.toStdString() + ".");

algorithm->initialize();
algorithm->setProperty("Filename", m_text);
const std::string propName = m_property.toStdString();
algorithm->setProperty(propName, m_text);

Property *prop = algorithm->getProperty(m_property.toStdString());
Property *prop = algorithm->getProperty(propName);

FileProperty *fileProp = dynamic_cast<FileProperty*>(prop);
MultipleFileProperty *multiFileProp = dynamic_cast<MultipleFileProperty*>(prop);
Expand All @@ -156,7 +157,7 @@ void FindFilesThread::getFilesFromAlgorithm()
}
else if( multiFileProp )
{
std::vector<std::vector<std::string> > filenames = algorithm->getProperty("Filename");
std::vector<std::vector<std::string> > filenames = algorithm->getProperty(propName);
std::vector<std::string> flattenedNames = MultipleFileProperty::flattenFileNames(filenames);

for( auto filename = flattenedNames.begin(); filename != flattenedNames.end(); ++filename )
Expand Down

0 comments on commit 24a4122

Please sign in to comment.