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++) for (size_t i = 0; i < SortOptions; i++)
{ {
MPD::Song::GetFunction get = (*SortDialog)[i].second; std::string sa = (a->*(*SortDialog)[i].second)();
if ((a->*get)() != (b->*get)()) std::string sb = (b->*(*SortDialog)[i].second)();
{ ToLower(sa);
return (a->*get)() < (b->*get)(); ToLower(sb);
} if (sa != sb)
return sa < sb;
} }
return a->GetPosition() < b->GetPosition(); return a->GetPosition() < b->GetPosition();
} }