Skip to content

Commit

Permalink
Merge pull request #1433 from ghutchis/revert-validate-filenames
Browse files Browse the repository at this point in the history
Revert validation of filenames.
  • Loading branch information
ghutchis committed Oct 31, 2023
2 parents b28b495 + af73338 commit b686e27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion avogadro/io/fileformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bool FileFormat::open(const std::string& fileName_, Operation mode_)
appendError("Error opening file: " + fileName_);
return false;
}
} else if (m_mode & Write && validateFileName(m_fileName)) {
} else if (m_mode & Write) {
auto* file = new ofstream(m_fileName.c_str(), std::ofstream::binary);
m_out = file;
if (file->is_open()) {
Expand Down
8 changes: 0 additions & 8 deletions avogadro/qtgui/fileformatdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ FileFormatDialog::FormatFilePair FileFormatDialog::fileToWrite(
if (fileName.isEmpty()) // user cancel
return result;

if (FileFormat::validateFileName(fileName.toStdString()) == false) {
QMessageBox::warning(
parentWidget, caption,
tr("The file name contains invalid characters. Please choose another "
"file name."));
continue;
}

const Io::FileFormat* format = findFileFormat(
parentWidget, caption, fileName, FileFormat::File | FileFormat::Write);

Expand Down

0 comments on commit b686e27

Please sign in to comment.