diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-02 20:51:20 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2012-09-02 20:51:20 +0200 |
commit | 5e8d1673e014e5d9af4c5538ae938d7c414a2ed3 (patch) | |
tree | 389d567eaa8a5e60a45b18048c6de1b5547ae914 /src/tag_editor.cpp | |
parent | 0cfe5d8f01cae20ea0751f28bf16c8a6ff818fc2 (diff) |
implement ProxySongList for handling general operations on lists
Diffstat (limited to 'src/tag_editor.cpp')
-rw-r--r-- | src/tag_editor.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/tag_editor.cpp b/src/tag_editor.cpp index 1450643e..91a817f8 100644 --- a/src/tag_editor.cpp +++ b/src/tag_editor.cpp @@ -854,33 +854,21 @@ void TagEditor::prevFound(bool wrap) /***********************************************************************/ -MPD::Song *TagEditor::getSong(size_t pos) +std::shared_ptr<ProxySongList> TagEditor::getProxySongList() { - MPD::Song *ptr = 0; + auto ptr = nullProxySongList(); if (w == Tags) - ptr = &(*Tags)[pos].value(); + ptr = mkProxySongList(*Tags, [](NC::Menu<MPD::MutableSong>::Item &item) { + return &item.value(); + }); return ptr; } -MPD::Song *TagEditor::currentSong() -{ - if (w == Tags && !Tags->Empty()) - return getSong(Tags->Choice()); - else - return 0; -} - bool TagEditor::allowsSelection() { return w == Tags; } -void TagEditor::removeSelection() -{ - if (w == Tags) - removeSelectionHelper(Tags->Begin(), Tags->End()); -} - void TagEditor::reverseSelection() { if (w == Tags) |