mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-22 17:26:21 +03:00
- Fix '!' support in label names
This commit is contained in:
parent
bd5880843f
commit
1b1dde3fc8
1 changed files with 8 additions and 4 deletions
12
src/misc.h
12
src/misc.h
|
@ -184,13 +184,17 @@ public:
|
|||
}
|
||||
|
||||
static QString toValidFileSystemName(QString filename) {
|
||||
filename = filename.replace("\\", "/");
|
||||
QRegExp regex("[/:!?\"*<>|]");
|
||||
return filename.replace(regex, " ");
|
||||
qDebug("toValidFSName: %s", filename.toLocal8Bit().data());
|
||||
filename = filename.replace("\\", "/").trimmed();
|
||||
QRegExp regex("[/:?\"*<>|]");
|
||||
filename = filename.replace(regex, " ").trimmed();
|
||||
qDebug("toValidFSName, result: %s", filename.toLocal8Bit().data());
|
||||
return filename;
|
||||
}
|
||||
|
||||
static bool isValidFileSystemName(QString filename) {
|
||||
filename = filename.replace("\\", "/");
|
||||
filename = filename.replace("\\", "/").trimmed();
|
||||
if(filename.isEmpty()) return false;
|
||||
QRegExp regex("[/:?\"*<>|]");
|
||||
if(filename.contains(regex))
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue