|
|
@ -184,13 +184,17 @@ public: |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static QString toValidFileSystemName(QString filename) { |
|
|
|
static QString toValidFileSystemName(QString filename) { |
|
|
|
filename = filename.replace("\\", "/"); |
|
|
|
qDebug("toValidFSName: %s", filename.toLocal8Bit().data()); |
|
|
|
QRegExp regex("[/:!?\"*<>|]"); |
|
|
|
filename = filename.replace("\\", "/").trimmed(); |
|
|
|
return filename.replace(regex, " "); |
|
|
|
QRegExp regex("[/:?\"*<>|]"); |
|
|
|
|
|
|
|
filename = filename.replace(regex, " ").trimmed(); |
|
|
|
|
|
|
|
qDebug("toValidFSName, result: %s", filename.toLocal8Bit().data()); |
|
|
|
|
|
|
|
return filename; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static bool isValidFileSystemName(QString filename) { |
|
|
|
static bool isValidFileSystemName(QString filename) { |
|
|
|
filename = filename.replace("\\", "/"); |
|
|
|
filename = filename.replace("\\", "/").trimmed(); |
|
|
|
|
|
|
|
if(filename.isEmpty()) return false; |
|
|
|
QRegExp regex("[/:?\"*<>|]"); |
|
|
|
QRegExp regex("[/:?\"*<>|]"); |
|
|
|
if(filename.contains(regex)) |
|
|
|
if(filename.contains(regex)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|