diff options
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 {// |