summaryrefslogtreecommitdiff
path: root/src/playlist_editor.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2014-11-02 00:22:02 +0100
committerAndrzej Rybczak <electricityispower@gmail.com>2014-11-02 22:14:29 +0100
commit0457af36fef70d795afaf56c13a105b2016caad6 (patch)
tree7891f7cea36ec7b8c6f1ce0108dd903e9825fe0b /src/playlist_editor.cpp
parent30d57afcace02b6347cd5e644bd0a987717237fc (diff)
mpd: redesign Item and adjust browser
Diffstat (limited to 'src/playlist_editor.cpp')
-rw-r--r--src/playlist_editor.cpp16
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 {//