- Validate new file names to make sure they are allowed by the file system

This commit is contained in:
Christophe Dumez 2010-01-05 12:28:42 +00:00
parent 037e57b687
commit 4fc777268b
31 changed files with 2717 additions and 1649 deletions

View file

@ -490,6 +490,12 @@ void PropertiesWidget::renameSelectedFile() {
tr("New name:"), QLineEdit::Normal,
index.data().toString(), &ok);
if (ok && !new_name_last.isEmpty()) {
if(!misc::isValidFileSystemName(new_name_last)) {
QMessageBox::warning(this, tr("The file could not be renamed"),
tr("This file name contains forbidden characters, please choose a different one."),
QMessageBox::Ok);
return;
}
if(PropListModel->getType(index)==TFILE) {
// File renaming
int file_index = PropListModel->getFileIndex(index);