Clean up misc::isValidFileSystemName() function

This commit is contained in:
Christophe Dumez 2012-02-15 21:57:40 +02:00
parent fb60a6489b
commit 68041e382d
2 changed files with 4 additions and 7 deletions

View file

@ -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