make use of std::locale based strings comparison

This commit is contained in:
Andrzej Rybczak
2012-09-08 03:35:52 +02:00
parent a26b1f62f9
commit 057922d2a6
5 changed files with 63 additions and 68 deletions

View File

@@ -197,9 +197,9 @@ void Playlist::EnterPressed()
for (; begin != end; ++begin)
playlist.push_back(begin->value());
LocaleStringComparison cmp(std::locale(""), Config.ignore_leading_the);
std::function<void(MPD::SongList::iterator, MPD::SongList::iterator)> iter_swap, quick_sort;
auto song_cmp = [](const MPD::Song &a, const MPD::Song &b) -> bool {
CaseInsensitiveStringComparison cmp(Config.ignore_leading_the);
auto song_cmp = [&cmp](const MPD::Song &a, const MPD::Song &b) -> bool {
for (size_t i = 0; i < SortOptions; ++i)
if (int ret = cmp(a.getTags((*SortDialog)[i].value().second), b.getTags((*SortDialog)[i].value().second)))
return ret < 0;