mpd: make GetRecursiveDirectory return SongIterator

This commit is contained in:
Andrzej Rybczak
2014-11-02 23:08:21 +01:00
parent afa8a34340
commit e5b0c7a357
5 changed files with 44 additions and 33 deletions

View File

@@ -346,16 +346,14 @@ MPD::SongList Browser::getSelectedSongs()
{
case MPD::Item::Type::Directory:
if (m_local_browser)
{
MPD::ItemList items;
getLocalDirectoryRecursively(songs, item.directory().path());
}
else
{
MPD::ItemIterator it = Mpd.GetDirectoryRecursive(item.directory().path()), end;
for (; it != end; ++it)
if (it->type() == MPD::Item::Type::Song)
songs.push_back(std::move(it->song()));
std::copy(
std::make_move_iterator(Mpd.GetDirectoryRecursive(item.directory().path())),
std::make_move_iterator(MPD::SongIterator()),
std::back_inserter(songs)
);
}
break;
case MPD::Item::Type::Song: