From 68b724d9decc88ec1821c03fd7365760e6773c57 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Tue, 25 Aug 2009 01:46:30 +0200 Subject: [PATCH] remove duplicated (and by the way quite broken) code --- src/ncmpcpp.cpp | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 69c2c6bc..43847223 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -1064,39 +1064,13 @@ int main(int argc, char *argv[]) SongList list; Mpd.GetDirectoryRecursive(path, list); if (!list.empty()) - { - Mpd.StartCommandsList(); - SongList::const_iterator it = list.begin(); - if (myScreen == myPlaylistEditor) - { - for (; it != list.end(); ++it) - Mpd.AddToPlaylist(myPlaylistEditor->Playlists->Current(), **it); - } - else - { - for (; it != list.end(); ++it) - if (Mpd.AddSong(**it) < 0) - break; - } - Mpd.CommitCommandsList(); - - if (it != list.begin() && myScreen != myPlaylistEditor) - { - Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-list.size()); - if (s.GetHash() != list[0]->GetHash()) - ShowMessage("%s", MPD::Message::PartOfSongsAdded); - } - } + myPlaylist->Add(list, 0); else { if (myScreen == myPlaylistEditor) - { Mpd.AddToPlaylist(myPlaylistEditor->Playlists->Current(), path); - } else - { Mpd.AddSong(path); - } } if (myScreen == myPlaylistEditor) myPlaylistEditor->Content->Clear(0); // make it refetch content of playlist