mpd: make ItemType enum class

This commit is contained in:
Andrzej Rybczak
2014-11-01 22:45:27 +01:00
parent 9a1afece86
commit fabd24c6a5
9 changed files with 50 additions and 53 deletions

View File

@@ -59,13 +59,13 @@ bool LocaleBasedItemSorting::operator()(const MPD::Item &a, const MPD::Item &b)
{
switch (a.type)
{
case MPD::itDirectory:
case MPD::Item::Type::Directory:
result = m_cmp(getBasename(a.name), getBasename(b.name));
break;
case MPD::itPlaylist:
case MPD::Item::Type::Playlist:
result = m_cmp(a.name, b.name);
break;
case MPD::itSong:
case MPD::Item::Type::Song:
switch (m_sort_mode)
{
case SortMode::Name:

View File

@@ -200,18 +200,18 @@ MPD::Song::GetFunction charToGetFunction(char c)
}
}
std::string itemTypeToString(MPD::ItemType type)
std::string itemTypeToString(MPD::Item::Type type)
{
std::string result;
switch (type)
{
case MPD::itDirectory:
case MPD::Item::Type::Directory:
result = "directory";
break;
case MPD::itSong:
case MPD::Item::Type::Song:
result = "song";
break;
case MPD::itPlaylist:
case MPD::Item::Type::Playlist:
result = "playlist";
break;
}

View File

@@ -35,6 +35,6 @@ MPD::MutableSong::SetFunction tagTypeToSetFunction(mpd_tag_type tag);
mpd_tag_type charToTagType(char c);
MPD::Song::GetFunction charToGetFunction(char c);
std::string itemTypeToString(MPD::ItemType type);
std::string itemTypeToString(MPD::Item::Type type);
#endif // NCMPCPP_UTILITY_TYPE_CONVERSIONS_H