Skip to content

Commit

Permalink
Refs #5092. Fix major error throwing when wrong string is passed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Whitley committed Apr 13, 2012
1 parent 1219ce6 commit a48c510
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
13 changes: 10 additions & 3 deletions Code/Mantid/Framework/API/src/FileFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,16 @@ namespace Mantid
std::string path = getFullPath(hint);
if (!path.empty())
{
g_log.information() << "found path = " << path << '\n';
return path;
} else {
if (Poco::File(path).exists() )
{
g_log.information() << "found path = " << path << '\n';
return path;
}
else
return "";
}
else
{
g_log.notice() << "Unable to find files via direcotry search with the filename that looks like a full filename" << "\n";
}
}
Expand Down
9 changes: 5 additions & 4 deletions Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,16 +947,17 @@ void MuonAnalysis::inputFileChanged_MWRunFiles()
* Do some check when reading from MWRun, before actually reading new data file, to see if file is valid
*/
void MuonAnalysis::handleInputFileChanges()
{
std::cout << "\n\n" << m_uiForm.mwRunFiles->getFirstFilename().toStdString() << "\n\n";

{
if ( m_uiForm.mwRunFiles->getText().isEmpty() )
return;

if ( !m_uiForm.mwRunFiles->isValid() )
{
QMessageBox::warning(this,"Mantid - MuonAnalysis", m_uiForm.mwRunFiles->getFileProblem() );
m_uiForm.mwRunFiles->setFileProblem("Error finding file. Reset to last working data.");
if (m_textToDisplay == "")
m_uiForm.mwRunFiles->setFileProblem("Error. No File specified.");
else
m_uiForm.mwRunFiles->setFileProblem("Error finding file. Reset to last working data.");
m_uiForm.mwRunFiles->setText(m_textToDisplay);
return;
}
Expand Down

0 comments on commit a48c510

Please sign in to comment.