mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Clean up misc::isValidFileSystemName() function
This commit is contained in:
parent
fb60a6489b
commit
68041e382d
2 changed files with 4 additions and 7 deletions
|
@ -575,13 +575,10 @@ QString misc::toValidFileSystemName(QString filename) {
|
|||
return filename;
|
||||
}
|
||||
|
||||
bool misc::isValidFileSystemName(QString filename) {
|
||||
filename.replace("\\", "/").trimmed();
|
||||
bool misc::isValidFileSystemName(const QString& filename) {
|
||||
if(filename.isEmpty()) return false;
|
||||
const QRegExp regex("[/:?\"*<>|]");
|
||||
if(filename.contains(regex))
|
||||
return false;
|
||||
return true;
|
||||
const QRegExp regex("[\\\\/:?\"*<>|]");
|
||||
return !filename.contains(regex);
|
||||
}
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue