comparators: generalize objects a bit

This commit is contained in:
Andrzej Rybczak
2012-09-08 14:34:46 +02:00
parent 691e0322e7
commit 8fb88b7181
12 changed files with 54 additions and 34 deletions

View File

@@ -423,7 +423,8 @@ void Browser::GetDirectory(std::string dir, std::string subdir)
list = Mpd.GetDirectory(dir);
# endif // !WIN32
if (!isLocal()) // local directory is already sorted
std::sort(list.begin(), list.end(), CaseInsensitiveSorting());
std::sort(list.begin(), list.end(),
LocaleBasedItemSorting(std::locale(), Config.ignore_leading_the, Config.browser_sort_mode));
for (MPD::ItemList::iterator it = list.begin(); it != list.end(); ++it)
{
@@ -519,7 +520,8 @@ void Browser::GetLocalDirectory(MPD::ItemList &v, const std::string &directory,
}
}
closedir(dir);
std::sort(v.begin()+old_size, v.end(), CaseInsensitiveSorting());
std::sort(v.begin()+old_size, v.end(),
LocaleBasedItemSorting(std::locale(), Config.ignore_leading_the, Config.browser_sort_mode));
}
void Browser::ClearDirectory(const std::string &path) const