finally kill NC::List

This commit is contained in:
Andrzej Rybczak
2012-09-02 20:55:22 +02:00
parent 5e8d1673e0
commit 684d871506
21 changed files with 1 additions and 105 deletions

View File

@@ -58,8 +58,6 @@ class Browser : public Screen< NC::Menu<MPD::Item> >, 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; }

View File

@@ -44,10 +44,6 @@ class Clock : public Screen<NC::Window>
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:

View File

@@ -36,10 +36,6 @@ class Help : public Screen<NC::Scrollpad>
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:

View File

@@ -46,10 +46,6 @@ class Lastfm : public Screen<NC::Scrollpad>
virtual void EnterPressed() { }
virtual void SpacePressed() { }
virtual bool allowsSelection() { return false; }
virtual NC::List *GetList() { return 0; }
virtual bool isMergable() { return true; }
void Refetch();

View File

@@ -47,10 +47,6 @@ class Lyrics : public Screen<NC::Scrollpad>
virtual void EnterPressed() { }
virtual void SpacePressed();
virtual bool allowsSelection() { return false; }
virtual NC::List *GetList() { return 0; }
virtual bool isMergable() { return true; }
void Edit();

View File

@@ -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()

View File

@@ -56,8 +56,6 @@ class MediaLibrary : public Screen<NC::Window>, public Filterable, public HasSon
virtual void reverseSelection();
virtual MPD::SongList getSelectedSongs();
virtual NC::List *GetList();
virtual bool isMergable() { return true; }
int Columns();

View File

@@ -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 <typename T> struct Menu : public Window, public List
template <typename T> struct Menu : public Window
{
struct Item
{

View File

@@ -42,10 +42,6 @@ class Outputs : public Screen< NC::Menu<MPD::Output> >
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();

View File

@@ -61,8 +61,6 @@ class Playlist : public Screen<NC::Window>, 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();

View File

@@ -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)

View File

@@ -57,8 +57,6 @@ class PlaylistEditor : public Screen<NC::Window>, public Filterable, public HasS
virtual void Locate(const std::string &);
virtual NC::List *GetList();
virtual bool isMergable() { return true; }
void MoveSelectedItems(Playlist::Movement where);

View File

@@ -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.

View File

@@ -102,8 +102,6 @@ class SearchEngine : public Screen< NC::Menu<SEItem> >, 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();

View File

@@ -38,10 +38,6 @@ class SelectedItemsAdder : public Screen< NC::Menu<std::string> >
virtual void SpacePressed() { }
virtual void MouseButtonPressed(MEVENT);
virtual bool allowsSelection() { return false; }
virtual NC::List *GetList() { return w; }
virtual bool isMergable() { return false; }
protected:

View File

@@ -36,10 +36,6 @@ class ServerInfo : public Screen<NC::Scrollpad>
virtual void EnterPressed() { }
virtual void SpacePressed() { }
virtual bool allowsSelection() { return false; }
virtual NC::List *GetList() { return 0; }
virtual bool isMergable() { return false; }
protected:

View File

@@ -42,10 +42,6 @@ class SongInfo : public Screen<NC::Scrollpad>
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[];

View File

@@ -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)

View File

@@ -67,8 +67,6 @@ class TagEditor : public Screen<NC::Window>, public Filterable, public HasSongs,
virtual void reverseSelection();
virtual MPD::SongList getSelectedSongs();
virtual NC::List *GetList();
virtual bool isMergable() { return true; }
bool isNextColumnAvailable();

View File

@@ -43,10 +43,6 @@ class TinyTagEditor : public Screen< NC::Menu<NC::Buffer> >
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 &);

View File

@@ -48,10 +48,6 @@ class Visualizer : public Screen<NC::Window>
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();