tag editor: put current pattern in extra braces (requred by cbbabee0)

This commit is contained in:
Andrzej Rybczak
2009-08-24 01:46:55 +02:00
parent 216b0b6af6
commit 08c1cee724
2 changed files with 4 additions and 4 deletions

View File

@@ -1191,7 +1191,7 @@ Song::SetFunction TagEditor::IntoSetFunction(char c)
} }
} }
std::string TagEditor::GenerateFilename(const Song &s, std::string &pattern) std::string TagEditor::GenerateFilename(const Song &s, const std::string &pattern)
{ {
std::string result = s.toString(pattern); std::string result = s.toString(pattern);
EscapeUnallowedChars(result); EscapeUnallowedChars(result);
@@ -1409,11 +1409,11 @@ void TagEditor::DealWithFilenames(SongList &v)
} }
else else
{ {
const std::string &file = s.GetName(); std::string file = s.GetName();
size_t last_dot = file.rfind("."); size_t last_dot = file.rfind(".");
std::string extension = file.substr(last_dot); std::string extension = file.substr(last_dot);
basic_buffer<my_char_t> new_file; basic_buffer<my_char_t> new_file;
new_file << TO_WSTRING(GenerateFilename(s, Config.pattern)); new_file << TO_WSTRING(GenerateFilename(s, "{" + Config.pattern + "}"));
if (new_file.Str().empty()) if (new_file.Str().empty())
{ {
if (preview) if (preview)

View File

@@ -115,7 +115,7 @@ class TagEditor : public Screen<Window>
static void GetPatternList(); static void GetPatternList();
static void SavePatternList(); static void SavePatternList();
static MPD::Song::SetFunction IntoSetFunction(char); static MPD::Song::SetFunction IntoSetFunction(char);
static std::string GenerateFilename(const MPD::Song &, std::string &); static std::string GenerateFilename(const MPD::Song &, const std::string &);
static std::string ParseFilename(MPD::Song &, std::string, bool); static std::string ParseFilename(MPD::Song &, std::string, bool);
static void DealWithFilenames(MPD::SongList &); static void DealWithFilenames(MPD::SongList &);