diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2014-11-02 00:22:02 +0100 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2014-11-02 22:14:29 +0100 |
commit | 0457af36fef70d795afaf56c13a105b2016caad6 (patch) | |
tree | 7891f7cea36ec7b8c6f1ce0108dd903e9825fe0b /src/playlist_editor.cpp | |
parent | 30d57afcace02b6347cd5e644bd0a987717237fc (diff) |
mpd: redesign Item and adjust browser
Diffstat (limited to 'src/playlist_editor.cpp')
-rw-r--r-- | src/playlist_editor.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/playlist_editor.cpp b/src/playlist_editor.cpp index d9b53ad4..6bc324b7 100644 --- a/src/playlist_editor.cpp +++ b/src/playlist_editor.cpp @@ -564,19 +564,17 @@ void PlaylistEditor::updateTimer() m_timer = Global::Timer; } -void PlaylistEditor::Locate(const std::string &name) +void PlaylistEditor::Locate(const MPD::Playlist &playlist) { update(); - for (size_t i = 0; i < Playlists.size(); ++i) + auto begin = Playlists.beginV(), end = Playlists.endV(); + auto it = std::find(begin, end, playlist); + if (it != end) { - if (name == Playlists[i].value().path()) - { - Playlists.highlight(i); - Content.clear(); - break; - } + Playlists.highlight(it-begin); + Content.clear(); + switchTo(); } - switchTo(); } namespace {// |