mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Validate new file names to make sure they are allowed by the file system
This commit is contained in:
parent
037e57b687
commit
4fc777268b
31 changed files with 2717 additions and 1649 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue