From 625e4dffdb114fd00021c19629f1ecfc60c41b56 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sat, 25 Sep 2010 15:04:58 +0000 Subject: [PATCH] Replace more invalid FAT32 characters in filenames. Fixes issue #799 --- src/core/organiseformat.cpp | 10 +++++++--- src/core/organiseformat.h | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/organiseformat.cpp b/src/core/organiseformat.cpp index 36e7f0435..f47b5e547 100644 --- a/src/core/organiseformat.cpp +++ b/src/core/organiseformat.cpp @@ -26,6 +26,10 @@ const QStringList OrganiseFormat::kKnownTags = QStringList() << "composer" << "track" << "disc" << "bpm" << "year" << "genre" << "comment" << "length" << "bitrate" << "samplerate" << "extension"; +// From http://en.wikipedia.org/wiki/8.3_filename#Directory_table +const char* OrganiseFormat::kInvalidFatCharacters = "\"*/\\:<>?|"; +const int OrganiseFormat::kInvalidFatCharactersCount = strlen(OrganiseFormat::kInvalidFatCharacters); + const QRgb OrganiseFormat::SyntaxHighlighter::kValidTagColorLight = qRgb(64, 64, 255); const QRgb OrganiseFormat::SyntaxHighlighter::kInvalidTagColorLight = qRgb(255, 64, 64); const QRgb OrganiseFormat::SyntaxHighlighter::kBlockColorLight = qRgb(230, 230, 230); @@ -152,9 +156,9 @@ QString OrganiseFormat::TagValue(const QString &tag, const Song &song) const { value.prepend('0'); // Replace characters that really shouldn't be in paths - value.replace('/', '_'); - value.replace('\\', '_'); - value.replace('?', '_'); + for (int i=0 ; i