mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
parent
ef8b37f7fa
commit
9dc3b18178
2 changed files with 15 additions and 3 deletions
|
@ -230,7 +230,19 @@ bool Utils::Fs::isValidFileSystemName(const QString &name, const bool allowSepar
|
|||
{
|
||||
if (name.isEmpty()) return false;
|
||||
|
||||
const QRegularExpression regex(allowSeparators ? "[:?\"*<>|]" : "[\\\\/:?\"*<>|]");
|
||||
#if defined(Q_OS_WIN)
|
||||
const QRegularExpression regex {allowSeparators
|
||||
? QLatin1String("[:?\"*<>|]")
|
||||
: QLatin1String("[\\\\/:?\"*<>|]")};
|
||||
#elif defined(Q_OS_MACOS)
|
||||
const QRegularExpression regex {allowSeparators
|
||||
? QLatin1String("[\\0:]")
|
||||
: QLatin1String("[\\0/:]")};
|
||||
#else
|
||||
const QRegularExpression regex {allowSeparators
|
||||
? QLatin1String("[\\0]")
|
||||
: QLatin1String("[\\0/]")};
|
||||
#endif
|
||||
return !name.contains(regex);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue