From 02d3ec0e2a87778f847b266a10cfde9194bafab0 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 14 May 2010 01:17:10 +0200 Subject: [PATCH] Browser::LocateSong: compare hashes, not strings I wonder why I wrote it this way. --- src/browser.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/browser.cpp b/src/browser.cpp index 57da6bfa..cdb87c90 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -324,13 +324,11 @@ void Browser::LocateSong(const MPD::Song &s) if (myScreen != this) SwitchTo(); - std::string option = s.toString(Config.song_status_format); - locale_to_utf(option); if (itsBrowsedDir != s.GetDirectory()) GetDirectory(s.GetDirectory()); for (size_t i = 0; i < w->Size(); ++i) { - if (w->at(i).type == itSong && option == w->at(i).song->toString(Config.song_status_format)) + if ((*w)[i].type == itSong && s.GetHash() == (*w)[i].song->GetHash()) { w->Highlight(i); break;