From fb03682df4ca5c5443f9d399be134bb890b6dedc Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 16 Feb 2012 20:32:13 +0200 Subject: [PATCH] Clean up misc::toValidFileSystemName() --- src/misc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/misc.cpp b/src/misc.cpp index 70dbbab67..7c80418d7 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -568,11 +568,10 @@ QString misc::updateLabelInSavePath(QString defaultSavePath, QString save_path, QString misc::toValidFileSystemName(QString filename) { qDebug("toValidFSName: %s", qPrintable(filename)); - filename.replace("\\", "/").trimmed(); - const QRegExp regex("[/:?\"*<>|]"); - filename.replace(regex, " ").trimmed(); + const QRegExp regex("[\\\\/:?\"*<>|]"); + filename.replace(regex, " "); qDebug("toValidFSName, result: %s", qPrintable(filename)); - return filename; + return filename.trimmed(); } bool misc::isValidFileSystemName(const QString& filename) {