From 684d871506f2b65d01b22e84992d9fb35d40af2a Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 2 Sep 2012 20:55:22 +0200 Subject: [PATCH] finally kill NC::List --- src/browser.h | 2 -- src/clock.h | 4 ---- src/help.h | 4 ---- src/lastfm.h | 4 ---- src/lyrics.h | 4 ---- src/media_library.cpp | 12 ------------ src/media_library.h | 2 -- src/menu.h | 15 +-------------- src/outputs.h | 4 ---- src/playlist.h | 2 -- src/playlist_editor.cpp | 13 ------------- src/playlist_editor.h | 2 -- src/screen.h | 4 ---- src/search_engine.h | 2 -- src/sel_items_adder.h | 4 ---- src/server_info.h | 4 ---- src/song_info.h | 4 ---- src/tag_editor.cpp | 10 ---------- src/tag_editor.h | 2 -- src/tiny_tag_editor.h | 4 ---- src/visualizer.h | 4 ---- 21 files changed, 1 insertion(+), 105 deletions(-) diff --git a/src/browser.h b/src/browser.h index 9affe26..6d73371 100644 --- a/src/browser.h +++ b/src/browser.h @@ -58,8 +58,6 @@ class Browser : public Screen< NC::Menu >, public Filterable, public virtual void reverseSelection(); virtual MPD::SongList getSelectedSongs(); - virtual NC::List *GetList() { return w; } - virtual bool isMergable() { return true; } const std::string &CurrentDir() { return itsBrowsedDir; } diff --git a/src/clock.h b/src/clock.h index 37524e2..f9736c1 100644 --- a/src/clock.h +++ b/src/clock.h @@ -44,10 +44,6 @@ class Clock : public Screen virtual void MouseButtonPressed(MEVENT) { } virtual bool isTabbable() { return true; } - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return 0; } - virtual bool isMergable() { return true; } protected: diff --git a/src/help.h b/src/help.h index dd3982f..b5b89a9 100644 --- a/src/help.h +++ b/src/help.h @@ -36,10 +36,6 @@ class Help : public Screen virtual void SpacePressed() { } virtual bool isTabbable() { return true; } - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return 0; } - virtual bool isMergable() { return true; } protected: diff --git a/src/lastfm.h b/src/lastfm.h index d2a9f3d..05e041a 100644 --- a/src/lastfm.h +++ b/src/lastfm.h @@ -46,10 +46,6 @@ class Lastfm : public Screen virtual void EnterPressed() { } virtual void SpacePressed() { } - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return 0; } - virtual bool isMergable() { return true; } void Refetch(); diff --git a/src/lyrics.h b/src/lyrics.h index e8284ae..f71efc0 100644 --- a/src/lyrics.h +++ b/src/lyrics.h @@ -47,10 +47,6 @@ class Lyrics : public Screen virtual void EnterPressed() { } virtual void SpacePressed(); - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return 0; } - virtual bool isMergable() { return true; } void Edit(); diff --git a/src/media_library.cpp b/src/media_library.cpp index 9a0800c..bc6d3bf 100644 --- a/src/media_library.cpp +++ b/src/media_library.cpp @@ -436,18 +436,6 @@ void MediaLibrary::MouseButtonPressed(MEVENT me) } } -NC::List *MediaLibrary::GetList() -{ - if (w == Tags) - return Tags; - else if (w == Albums) - return Albums; - else if (w == Songs) - return Songs; - else // silence compiler - return 0; -} - /***********************************************************************/ std::string MediaLibrary::currentFilter() diff --git a/src/media_library.h b/src/media_library.h index 0401950..3b38cce 100644 --- a/src/media_library.h +++ b/src/media_library.h @@ -56,8 +56,6 @@ class MediaLibrary : public Screen, public Filterable, public HasSon virtual void reverseSelection(); virtual MPD::SongList getSelectedSongs(); - virtual NC::List *GetList(); - virtual bool isMergable() { return true; } int Columns(); diff --git a/src/menu.h b/src/menu.h index ed6628a..093de1f 100644 --- a/src/menu.h +++ b/src/menu.h @@ -33,22 +33,9 @@ namespace NC { -/// List class is an interface for Menu class -struct List -{ - /// @return currently highlighted position - virtual size_t Choice() const = 0; - - /// @see Menu::Empty() - virtual bool Empty() const = 0; - - /// @see Menu::Size() - virtual size_t Size() const = 0; -}; - /// This template class is generic menu capable of /// holding any std::vector compatible values. -template struct Menu : public Window, public List +template struct Menu : public Window { struct Item { diff --git a/src/outputs.h b/src/outputs.h index 501ca88..92c2e9f 100644 --- a/src/outputs.h +++ b/src/outputs.h @@ -42,10 +42,6 @@ class Outputs : public Screen< NC::Menu > virtual void MouseButtonPressed(MEVENT); virtual bool isTabbable() { return true; } - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return w; } - virtual bool isMergable() { return true; } void FetchList(); diff --git a/src/playlist.h b/src/playlist.h index 4702953..562c1a7 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -61,8 +61,6 @@ class Playlist : public Screen, public Filterable, public HasSongs, virtual void reverseSelection(); virtual MPD::SongList getSelectedSongs(); - virtual NC::List *GetList() { return w == Items ? Items : 0; } - virtual bool isMergable() { return true; } bool isFiltered(); diff --git a/src/playlist_editor.cpp b/src/playlist_editor.cpp index f98ac26..cee497b 100644 --- a/src/playlist_editor.cpp +++ b/src/playlist_editor.cpp @@ -564,19 +564,6 @@ void PlaylistEditor::Locate(const std::string &name) SwitchTo(); } -NC::List *PlaylistEditor::GetList() -{ - if (w == Playlists) - return Playlists; - else if (w == Content) - return Content; - else // silence compiler - { - assert(false); - return 0; - } -} - namespace {// std::string SongToString(const MPD::Song &s) diff --git a/src/playlist_editor.h b/src/playlist_editor.h index 1afb62d..266a041 100644 --- a/src/playlist_editor.h +++ b/src/playlist_editor.h @@ -57,8 +57,6 @@ class PlaylistEditor : public Screen, public Filterable, public HasS virtual void Locate(const std::string &); - virtual NC::List *GetList(); - virtual bool isMergable() { return true; } void MoveSelectedItems(Playlist::Movement where); diff --git a/src/screen.h b/src/screen.h index 455551a..d232d2a 100644 --- a/src/screen.h +++ b/src/screen.h @@ -74,10 +74,6 @@ class BasicScreen /// @see Screen::MouseButtonPressed() virtual void MouseButtonPressed(MEVENT) { } - - /// @return pointer to instantiation of Menu template class - /// cast to List if available or null pointer otherwise - virtual NC::List *GetList() = 0; /// When this is overwritten with a function returning true, the /// screen will be used in tab switching. diff --git a/src/search_engine.h b/src/search_engine.h index fae889a..a159c25 100644 --- a/src/search_engine.h +++ b/src/search_engine.h @@ -102,8 +102,6 @@ class SearchEngine : public Screen< NC::Menu >, public Filterable, publi virtual void reverseSelection(); virtual MPD::SongList getSelectedSongs(); - virtual NC::List *GetList() { return w->Size() >= StaticOptions ? w : 0; } - virtual bool isMergable() { return true; } void UpdateFoundList(); diff --git a/src/sel_items_adder.h b/src/sel_items_adder.h index 4e37e76..0375803 100644 --- a/src/sel_items_adder.h +++ b/src/sel_items_adder.h @@ -38,10 +38,6 @@ class SelectedItemsAdder : public Screen< NC::Menu > virtual void SpacePressed() { } virtual void MouseButtonPressed(MEVENT); - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return w; } - virtual bool isMergable() { return false; } protected: diff --git a/src/server_info.h b/src/server_info.h index 298a61a..b58f706 100644 --- a/src/server_info.h +++ b/src/server_info.h @@ -36,10 +36,6 @@ class ServerInfo : public Screen virtual void EnterPressed() { } virtual void SpacePressed() { } - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return 0; } - virtual bool isMergable() { return false; } protected: diff --git a/src/song_info.h b/src/song_info.h index 98c9c64..6522016 100644 --- a/src/song_info.h +++ b/src/song_info.h @@ -42,10 +42,6 @@ class SongInfo : public Screen virtual void EnterPressed() { } virtual void SpacePressed() { } - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return 0; } - virtual bool isMergable() { return true; } static const Metadata Tags[]; diff --git a/src/tag_editor.cpp b/src/tag_editor.cpp index 91a817f..27fe2d9 100644 --- a/src/tag_editor.cpp +++ b/src/tag_editor.cpp @@ -892,16 +892,6 @@ MPD::SongList TagEditor::getSelectedSongs() /***********************************************************************/ -NC::List *TagEditor::GetList() -{ - if (w == LeftColumn) - return LeftColumn; - else if (w == Tags) - return Tags; - else - return 0; -} - bool TagEditor::isNextColumnAvailable() { if (w == LeftColumn) diff --git a/src/tag_editor.h b/src/tag_editor.h index a62c3e8..bc00b77 100644 --- a/src/tag_editor.h +++ b/src/tag_editor.h @@ -67,8 +67,6 @@ class TagEditor : public Screen, public Filterable, public HasSongs, virtual void reverseSelection(); virtual MPD::SongList getSelectedSongs(); - virtual NC::List *GetList(); - virtual bool isMergable() { return true; } bool isNextColumnAvailable(); diff --git a/src/tiny_tag_editor.h b/src/tiny_tag_editor.h index c734646..75349fb 100644 --- a/src/tiny_tag_editor.h +++ b/src/tiny_tag_editor.h @@ -43,10 +43,6 @@ class TinyTagEditor : public Screen< NC::Menu > virtual void SpacePressed() { } virtual void MouseButtonPressed(MEVENT); - virtual bool allowsSelection() { return false; } - - virtual NC::List *GetList() { return 0; } - virtual bool isMergable() { return true; } void SetEdited(const MPD::Song &); diff --git a/src/visualizer.h b/src/visualizer.h index b8ae9a9..8082be1 100644 --- a/src/visualizer.h +++ b/src/visualizer.h @@ -48,10 +48,6 @@ class Visualizer : public Screen virtual void MouseButtonPressed(MEVENT) { } virtual bool isTabbable() { return true; } - virtual NC::List *GetList() { return 0; } - - virtual bool allowsSelection() { return false; } - virtual bool isMergable() { return true; } void SetFD(); -- 2.11.4.GIT