Browser::LocateSong: compare hashes, not strings

I wonder why I wrote it this way.
This commit is contained in:
Andrzej Rybczak
2010-05-14 01:17:10 +02:00
parent e978cfcc8b
commit 02d3ec0e2a

View File

@@ -324,13 +324,11 @@ void Browser::LocateSong(const MPD::Song &s)
if (myScreen != this) if (myScreen != this)
SwitchTo(); SwitchTo();
std::string option = s.toString(Config.song_status_format);
locale_to_utf(option);
if (itsBrowsedDir != s.GetDirectory()) if (itsBrowsedDir != s.GetDirectory())
GetDirectory(s.GetDirectory()); GetDirectory(s.GetDirectory());
for (size_t i = 0; i < w->Size(); ++i) 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); w->Highlight(i);
break; break;