make sorting playlist case insensitive

This commit is contained in:
Andrzej Rybczak
2009-02-19 18:20:43 +01:00
parent 9eec588be5
commit 1d55d4c4a1

View File

@@ -252,11 +252,12 @@ bool Playlist::Sorting(MPD::Song *a, MPD::Song *b)
{
for (size_t i = 0; i < SortOptions; i++)
{
MPD::Song::GetFunction get = (*SortDialog)[i].second;
if ((a->*get)() != (b->*get)())
{
return (a->*get)() < (b->*get)();
}
std::string sa = (a->*(*SortDialog)[i].second)();
std::string sb = (b->*(*SortDialog)[i].second)();
ToLower(sa);
ToLower(sb);
if (sa != sb)
return sa < sb;
}
return a->GetPosition() < b->GetPosition();
}