configure: require c++14 compatible compiler

This commit is contained in:
Andrzej Rybczak
2016-11-13 11:04:23 +01:00
parent 40163dedaa
commit 41317d31c8
29 changed files with 549 additions and 591 deletions

1
NEWS
View File

@@ -2,6 +2,7 @@ ncmpcpp-0.8 (????-??-??)
* Configuration variable 'execute_on_player_state_change' was added.
* Support for controlling whether ncmpcpp should display multiple tags as-is or make an effort to hide duplicate values (show_duplicate_tags configuration variable, enabled by default).
* Support for filtering of lists was brought back from the dead.
* Require C++14 compatible compiler during compilation.
ncmpcpp-0.7.7 (2016-10-31)
* Fixed compilation on 32bit platforms.

View File

@@ -28,70 +28,27 @@ if test "$clock" = "yes"; then
fi
dnl ================================
dnl = checking for -std=c++0x flag =
dnl = checking for -std=c++14 flag =
dnl ================================
AC_MSG_CHECKING([whether compiler supports -std=c++0x])
AC_MSG_CHECKING([whether compiler supports -std=c++14])
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-std=c++0x"
CXXFLAGS="-std=c++14"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]])],
AC_MSG_RESULT([yes])
std_cpp0x="-std=c++0x",
std_cpp14="-std=c++14",
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support C++0x, please upgrade (GCC >= 4.6)]])
AC_MSG_ERROR([[Your compiler doesn't seem to support C++14, please upgrade (GCC >= 5)]])
)
CXXFLAGS="$old_CXXFLAGS $std_cpp0x"
CXXFLAGS="$old_CXXFLAGS $std_cpp14"
dnl ==========================================
dnl = checking for initializer lists support =
dnl ==========================================
AC_MSG_CHECKING([whether compiler supports initializer lists])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <vector>], [[std::vector<int> test = { 1, 2, 3 }; test.push_back(4);]])],
dnl ===================================================
dnl = checking for generic lambda expressions support =
dnl ===================================================
AC_MSG_CHECKING([whether compiler supports generic lambda expressions])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[auto f = [](auto n) { return n*n; }; f(7);]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support initializer lists, please upgrade (GCC >= 4.6)]])
)
dnl =====================================
dnl = checking for auto keyword support =
dnl =====================================
AC_MSG_CHECKING([whether compiler supports auto keyword])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[auto test = new int; *test = 1;]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support auto keyword, please upgrade (GCC >= 4.6)]])
)
dnl =========================================
dnl = checking for lambda functions support =
dnl =========================================
AC_MSG_CHECKING([whether compiler supports lambda functions])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <functional>], [[int a = 5; std::function<int(int)> f = [&a](int b) { return a + b; }; f(8);]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support lambda functions, please upgrade (GCC >= 4.6)]])
)
dnl ================================================================
dnl = checking whether calling derived member function of object =
dnl = passed to lambda without explicit 'this' usage works =
dnl ================================================================
AC_MSG_CHECKING([whether calling derived member function passed to lambda without explicit this usage works ])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <functional>], [[struct A { void foo() { } }; struct B : public A { void bar() { std::function<void()> f = [this]() { foo(); }; f(); } } foo; foo.bar();]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support calling derived member function of an object passed to lambda as 'this' without explicit 'this' usage, please upgrade (GCC >= 4.6)]])
)
dnl =========================================
dnl = checking for override keyword support =
dnl =========================================
AH_TEMPLATE([OVERRIDE], [override keyword used in C++11])
AC_MSG_CHECKING([whether compiler supports override keyword])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct A { virtual void foo() { } }; struct B : public A { virtual void foo() override { } };]], [])],
AC_MSG_RESULT([yes])
AC_DEFINE([OVERRIDE], [override]),
AC_MSG_RESULT([no])
AC_DEFINE([OVERRIDE], []),
AC_MSG_ERROR([[Your compiler doesn't seem to support generic lambda expressions, please upgrade (GCC >= 5)]])
)
dnl =============================

File diff suppressed because it is too large Load Diff

View File

@@ -33,14 +33,14 @@ struct BrowserWindow: NC::Menu<MPD::Item>, SongList
BrowserWindow(NC::Menu<MPD::Item> &&base)
: NC::Menu<MPD::Item>(std::move(base)) { }
virtual SongIterator currentS() OVERRIDE;
virtual ConstSongIterator currentS() const OVERRIDE;
virtual SongIterator beginS() OVERRIDE;
virtual ConstSongIterator beginS() const OVERRIDE;
virtual SongIterator endS() OVERRIDE;
virtual ConstSongIterator endS() const OVERRIDE;
virtual SongIterator currentS() override;
virtual ConstSongIterator currentS() const override;
virtual SongIterator beginS() override;
virtual ConstSongIterator beginS() const override;
virtual SongIterator endS() override;
virtual ConstSongIterator endS() const override;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() override;
};
struct Browser: Screen<BrowserWindow>, Filterable, HasSongs, Searchable, Tabbable
@@ -48,35 +48,35 @@ struct Browser: Screen<BrowserWindow>, Filterable, HasSongs, Searchable, Tabbabl
Browser();
// Screen<BrowserWindow> implementation
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() override;
virtual void switchTo() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Browser; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Browser; }
virtual void update() OVERRIDE;
virtual void update() override;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// Searchable implementation
virtual bool allowsSearching() OVERRIDE;
virtual const std::string &searchConstraint() OVERRIDE;
virtual void setSearchConstraint(const std::string &constraint) OVERRIDE;
virtual void clearSearchConstraint() OVERRIDE;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) OVERRIDE;
virtual bool allowsSearching() override;
virtual const std::string &searchConstraint() override;
virtual void setSearchConstraint(const std::string &constraint) override;
virtual void clearSearchConstraint() override;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) override;
// Filterable implemenetation
virtual bool allowsFiltering() OVERRIDE;
virtual std::string currentFilter() OVERRIDE;
virtual void applyFilter(const std::string &filter) OVERRIDE;
virtual bool allowsFiltering() override;
virtual std::string currentFilter() override;
virtual void applyFilter(const std::string &filter) override;
// HasSongs implementation
virtual bool itemAvailable() OVERRIDE;
virtual bool addItemToPlaylist(bool play) OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual bool itemAvailable() override;
virtual bool addItemToPlaylist(bool play) override;
virtual std::vector<MPD::Song> getSelectedSongs() override;
// private members
void requestUpdate() { m_update_request = true; }

View File

@@ -33,19 +33,19 @@ struct Clock: Screen<NC::Window>, Tabbable
{
Clock();
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() override;
virtual void switchTo() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Clock; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Clock; }
virtual void update() OVERRIDE;
virtual void scroll(NC::Scroll) OVERRIDE { }
virtual void update() override;
virtual void scroll(NC::Scroll) override { }
virtual void mouseButtonPressed(MEVENT) OVERRIDE { }
virtual void mouseButtonPressed(MEVENT) override { }
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return true; }
private:
NC::Window m_pane;

View File

@@ -29,16 +29,16 @@ struct Help: Screen<NC::Scrollpad>, Tabbable
{
Help();
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() override;
virtual void switchTo() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Help; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Help; }
virtual void update() OVERRIDE { }
virtual void update() override { }
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
};
extern Help *myHelp;

View File

@@ -37,16 +37,16 @@ struct Lastfm: Screen<NC::Scrollpad>, Tabbable
{
Lastfm();
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Lastfm; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Lastfm; }
virtual void update() OVERRIDE;
virtual void update() override;
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return true; }
template <typename ServiceT>
void queueJob(ServiceT *service)

View File

@@ -34,16 +34,16 @@ struct Lyrics: Screen<NC::Scrollpad>, Tabbable
Lyrics();
// Screen<NC::Scrollpad> implementation
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() override;
virtual void switchTo() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Lyrics; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Lyrics; }
virtual void update() OVERRIDE;
virtual void update() override;
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return true; }
// private members
bool SetSong(const MPD::Song &s);

View File

@@ -48,14 +48,14 @@ protected:
struct LyricwikiFetcher : public LyricsFetcher
{
virtual const char *name() const OVERRIDE { return "lyricwiki.com"; }
virtual Result fetch(const std::string &artist, const std::string &title) OVERRIDE;
virtual const char *name() const override { return "lyricwiki.com"; }
virtual Result fetch(const std::string &artist, const std::string &title) override;
protected:
virtual const char *urlTemplate() const OVERRIDE { return "http://lyrics.wikia.com/api.php?action=lyrics&fmt=xml&func=getSong&artist=%artist%&song=%title%"; }
virtual const char *regex() const OVERRIDE { return "<url>(.*?)</url>"; }
virtual const char *urlTemplate() const override { return "http://lyrics.wikia.com/api.php?action=lyrics&fmt=xml&func=getSong&artist=%artist%&song=%title%"; }
virtual const char *regex() const override { return "<url>(.*?)</url>"; }
virtual bool notLyrics(const std::string &data) const OVERRIDE;
virtual bool notLyrics(const std::string &data) const override;
};
/**********************************************************************/
@@ -76,56 +76,56 @@ private:
struct MetrolyricsFetcher : public GoogleLyricsFetcher
{
virtual const char *name() const OVERRIDE { return "metrolyrics.com"; }
virtual const char *name() const override { return "metrolyrics.com"; }
protected:
virtual const char *regex() const OVERRIDE { return "<div class=\"lyrics-body\">(.*?)</div>"; }
virtual const char *regex() const override { return "<div class=\"lyrics-body\">(.*?)</div>"; }
virtual bool isURLOk(const std::string &url) OVERRIDE;
virtual bool isURLOk(const std::string &url) override;
};
struct LyricsmaniaFetcher : public GoogleLyricsFetcher
{
virtual const char *name() const OVERRIDE { return "lyricsmania.com"; }
virtual const char *name() const override { return "lyricsmania.com"; }
protected:
virtual const char *regex() const OVERRIDE { return "<div class=\"lyrics-body\".*?</strong>(.*?)</div>"; }
virtual const char *regex() const override { return "<div class=\"lyrics-body\".*?</strong>(.*?)</div>"; }
};
struct Sing365Fetcher : public GoogleLyricsFetcher
{
virtual const char *name() const OVERRIDE { return "sing365.com"; }
virtual const char *name() const override { return "sing365.com"; }
protected:
virtual const char *regex() const OVERRIDE { return "<!-Lyrics Begin->(.*?)<!-Lyrics End->"; }
virtual const char *regex() const override { return "<!-Lyrics Begin->(.*?)<!-Lyrics End->"; }
};
struct JustSomeLyricsFetcher : public GoogleLyricsFetcher
{
virtual const char *name() const OVERRIDE { return "justsomelyrics.com"; }
virtual const char *name() const override { return "justsomelyrics.com"; }
protected:
virtual const char *regex() const OVERRIDE { return "<div class=\"content.*?</div>\\s*</div>(.*?)<div"; }
virtual const char *regex() const override { return "<div class=\"content.*?</div>\\s*</div>(.*?)<div"; }
};
struct AzLyricsFetcher : public GoogleLyricsFetcher
{
virtual const char *name() const OVERRIDE { return "azlyrics.com"; }
virtual const char *name() const override { return "azlyrics.com"; }
protected:
virtual const char *regex() const OVERRIDE { return "<div class=\"lyricsh\">.*?</h2>.*<div>(.*?)</div>"; }
virtual const char *regex() const override { return "<div class=\"lyricsh\">.*?</h2>.*<div>(.*?)</div>"; }
};
struct InternetLyricsFetcher : public GoogleLyricsFetcher
{
virtual const char *name() const OVERRIDE { return "the Internet"; }
virtual Result fetch(const std::string &artist, const std::string &title) OVERRIDE;
virtual const char *name() const override { return "the Internet"; }
virtual Result fetch(const std::string &artist, const std::string &title) override;
protected:
virtual const char *siteKeyword() const OVERRIDE { return "lyrics"; }
virtual const char *regex() const OVERRIDE { return ""; }
virtual const char *siteKeyword() const override { return "lyrics"; }
virtual const char *regex() const override { return ""; }
virtual bool isURLOk(const std::string &url) OVERRIDE;
virtual bool isURLOk(const std::string &url) override;
private:
std::string URL;

View File

@@ -32,7 +32,7 @@ struct PushCharacters: BaseAction
PushCharacters(NC::Window **w, std::vector<NC::Key::Type> &&queue);
private:
virtual void run() OVERRIDE;
virtual void run() override;
NC::Window **m_window;
std::vector<NC::Key::Type> m_queue;
@@ -43,8 +43,8 @@ struct RequireRunnable: BaseAction
RequireRunnable(BaseAction *action);
private:
virtual bool canBeRun() OVERRIDE;
virtual void run() OVERRIDE { }
virtual bool canBeRun() override;
virtual void run() override { }
BaseAction *m_action;
};
@@ -54,8 +54,8 @@ struct RequireScreen: BaseAction
RequireScreen(ScreenType screen_type);
private:
virtual bool canBeRun() OVERRIDE;
virtual void run() OVERRIDE { }
virtual bool canBeRun() override;
virtual void run() override { }
ScreenType m_screen_type;
};
@@ -65,7 +65,7 @@ struct RunExternalCommand: BaseAction
RunExternalCommand(std::string command);
private:
virtual void run() OVERRIDE;
virtual void run() override;
std::string m_command;
};

View File

@@ -32,45 +32,45 @@ struct MediaLibrary: Screen<NC::Window *>, Filterable, HasColumns, HasSongs, Sea
{
MediaLibrary();
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::MediaLibrary; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::MediaLibrary; }
virtual void refresh() OVERRIDE;
virtual void update() OVERRIDE;
virtual void refresh() override;
virtual void update() override;
virtual int windowTimeout() OVERRIDE;
virtual int windowTimeout() override;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// Searchable implementation
virtual bool allowsSearching() OVERRIDE;
virtual const std::string &searchConstraint() OVERRIDE;
virtual void setSearchConstraint(const std::string &constraint) OVERRIDE;
virtual void clearSearchConstraint() OVERRIDE;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) OVERRIDE;
virtual bool allowsSearching() override;
virtual const std::string &searchConstraint() override;
virtual void setSearchConstraint(const std::string &constraint) override;
virtual void clearSearchConstraint() override;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) override;
// Filterable implementation
virtual bool allowsFiltering() OVERRIDE;
virtual std::string currentFilter() OVERRIDE;
virtual void applyFilter(const std::string &filter) OVERRIDE;
virtual bool allowsFiltering() override;
virtual std::string currentFilter() override;
virtual void applyFilter(const std::string &filter) override;
// HasSongs implementation
virtual bool itemAvailable() OVERRIDE;
virtual bool addItemToPlaylist(bool play) OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual bool itemAvailable() override;
virtual bool addItemToPlaylist(bool play) override;
virtual std::vector<MPD::Song> getSelectedSongs() override;
// HasColumns implementation
virtual bool previousColumnAvailable() OVERRIDE;
virtual void previousColumn() OVERRIDE;
virtual bool previousColumnAvailable() override;
virtual void previousColumn() override;
virtual bool nextColumnAvailable() OVERRIDE;
virtual void nextColumn() OVERRIDE;
virtual bool nextColumnAvailable() override;
virtual void nextColumn() override;
// other members
void updateTimer();

View File

@@ -314,30 +314,30 @@ struct Menu: Window, List
/// Checks if list is empty
/// @return true if list is empty, false otherwise
virtual bool empty() const OVERRIDE { return m_items->empty(); }
virtual bool empty() const override { return m_items->empty(); }
/// @return size of the list
virtual size_t size() const OVERRIDE { return m_items->size(); }
virtual size_t size() const override { return m_items->size(); }
/// @return currently highlighted position
virtual size_t choice() const OVERRIDE;
virtual size_t choice() const override;
/// Highlights given position
/// @param pos position to be highlighted
virtual void highlight(size_t position) OVERRIDE;
virtual void highlight(size_t position) override;
/// Refreshes the menu window
/// @see Window::refresh()
virtual void refresh() OVERRIDE;
virtual void refresh() override;
/// Scrolls by given amount of lines
/// @param where indicated where exactly one wants to go
/// @see Window::scroll()
virtual void scroll(Scroll where) OVERRIDE;
virtual void scroll(Scroll where) override;
/// Cleares all options, used filters etc. It doesn't reset highlighted position though.
/// @see reset()
virtual void clear() OVERRIDE;
virtual void clear() override;
/// Sets highlighted position to 0
void reset();
@@ -468,22 +468,22 @@ struct Menu: Window, List
ReverseValueIterator rendV() { return ReverseValueIterator(beginV()); }
ConstReverseValueIterator rendV() const { return ConstReverseValueIterator(beginV()); }
virtual List::Iterator currentP() OVERRIDE {
virtual List::Iterator currentP() override {
return List::Iterator(PropertiesIterator(m_items->begin() + m_highlight));
}
virtual List::ConstIterator currentP() const OVERRIDE {
virtual List::ConstIterator currentP() const override {
return List::ConstIterator(ConstPropertiesIterator(m_items->begin() + m_highlight));
}
virtual List::Iterator beginP() OVERRIDE {
virtual List::Iterator beginP() override {
return List::Iterator(PropertiesIterator(m_items->begin()));
}
virtual List::ConstIterator beginP() const OVERRIDE {
virtual List::ConstIterator beginP() const override {
return List::ConstIterator(ConstPropertiesIterator(m_items->begin()));
}
virtual List::Iterator endP() OVERRIDE {
virtual List::Iterator endP() override {
return List::Iterator(PropertiesIterator(m_items->end()));
}
virtual List::ConstIterator endP() const OVERRIDE {
virtual List::ConstIterator endP() const override {
return List::ConstIterator(ConstPropertiesIterator(m_items->end()));
}

View File

@@ -34,17 +34,17 @@ struct MutableSong : public Song
MutableSong() : m_mtime(0), m_duration(0) { }
MutableSong(Song s) : Song(s), m_mtime(0), m_duration(0) { }
virtual std::string getArtist(unsigned idx = 0) const OVERRIDE;
virtual std::string getTitle(unsigned idx = 0) const OVERRIDE;
virtual std::string getAlbum(unsigned idx = 0) const OVERRIDE;
virtual std::string getAlbumArtist(unsigned idx = 0) const OVERRIDE;
virtual std::string getTrack(unsigned idx = 0) const OVERRIDE;
virtual std::string getDate(unsigned idx = 0) const OVERRIDE;
virtual std::string getGenre(unsigned idx = 0) const OVERRIDE;
virtual std::string getComposer(unsigned idx = 0) const OVERRIDE;
virtual std::string getPerformer(unsigned idx = 0) const OVERRIDE;
virtual std::string getDisc(unsigned idx = 0) const OVERRIDE;
virtual std::string getComment(unsigned idx = 0) const OVERRIDE;
virtual std::string getArtist(unsigned idx = 0) const override;
virtual std::string getTitle(unsigned idx = 0) const override;
virtual std::string getAlbum(unsigned idx = 0) const override;
virtual std::string getAlbumArtist(unsigned idx = 0) const override;
virtual std::string getTrack(unsigned idx = 0) const override;
virtual std::string getDate(unsigned idx = 0) const override;
virtual std::string getGenre(unsigned idx = 0) const override;
virtual std::string getComposer(unsigned idx = 0) const override;
virtual std::string getPerformer(unsigned idx = 0) const override;
virtual std::string getDisc(unsigned idx = 0) const override;
virtual std::string getComment(unsigned idx = 0) const override;
void setArtist(const std::string &value, unsigned idx = 0);
void setTitle(const std::string &value, unsigned idx = 0);
@@ -61,8 +61,8 @@ struct MutableSong : public Song
const std::string &getNewName() const;
void setNewName(const std::string &value);
virtual unsigned getDuration() const OVERRIDE;
virtual time_t getMTime() const OVERRIDE;
virtual unsigned getDuration() const override;
virtual time_t getMTime() const override;
void setDuration(unsigned duration);
void setMTime(time_t mtime);

View File

@@ -35,18 +35,18 @@ struct Outputs: Screen<NC::Menu<MPD::Output>>, Tabbable
Outputs();
// Screen< NC::Menu<MPD::Output> > implementation
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Outputs; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Outputs; }
virtual void update() OVERRIDE { }
virtual void update() override { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// private members
void fetchList();

View File

@@ -35,35 +35,35 @@ struct Playlist: Screen<SongMenu>, Filterable, HasSongs, Searchable, Tabbable
Playlist();
// Screen<SongMenu> implementation
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Playlist; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Playlist; }
virtual void update() OVERRIDE;
virtual void update() override;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// Searchable implementation
virtual bool allowsSearching() OVERRIDE;
virtual const std::string &searchConstraint() OVERRIDE;
virtual void setSearchConstraint(const std::string &constraint) OVERRIDE;
virtual void clearSearchConstraint() OVERRIDE;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) OVERRIDE;
virtual bool allowsSearching() override;
virtual const std::string &searchConstraint() override;
virtual void setSearchConstraint(const std::string &constraint) override;
virtual void clearSearchConstraint() override;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) override;
// Filterable implementation
virtual bool allowsFiltering() OVERRIDE;
virtual std::string currentFilter() OVERRIDE;
virtual void applyFilter(const std::string &filter) OVERRIDE;
virtual bool allowsFiltering() override;
virtual std::string currentFilter() override;
virtual void applyFilter(const std::string &filter) override;
// HasSongs implementation
virtual bool itemAvailable() OVERRIDE;
virtual bool addItemToPlaylist(bool play) OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual bool itemAvailable() override;
virtual bool addItemToPlaylist(bool play) override;
virtual std::vector<MPD::Song> getSelectedSongs() override;
// other members
MPD::Song nowPlayingSong();

View File

@@ -32,45 +32,45 @@ struct PlaylistEditor: Screen<NC::Window *>, Filterable, HasColumns, HasSongs, S
{
PlaylistEditor();
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::PlaylistEditor; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::PlaylistEditor; }
virtual void refresh() OVERRIDE;
virtual void update() OVERRIDE;
virtual void refresh() override;
virtual void update() override;
virtual int windowTimeout() OVERRIDE;
virtual int windowTimeout() override;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// Searchable implementation
virtual bool allowsSearching() OVERRIDE;
virtual const std::string &searchConstraint() OVERRIDE;
virtual void setSearchConstraint(const std::string &constraint) OVERRIDE;
virtual void clearSearchConstraint() OVERRIDE;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) OVERRIDE;
virtual bool allowsSearching() override;
virtual const std::string &searchConstraint() override;
virtual void setSearchConstraint(const std::string &constraint) override;
virtual void clearSearchConstraint() override;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) override;
// Filterable implementation
virtual bool allowsFiltering() OVERRIDE;
virtual std::string currentFilter() OVERRIDE;
virtual void applyFilter(const std::string &filter) OVERRIDE;
virtual bool allowsFiltering() override;
virtual std::string currentFilter() override;
virtual void applyFilter(const std::string &filter) override;
// HasSongs implementation
virtual bool itemAvailable() OVERRIDE;
virtual bool addItemToPlaylist(bool play) OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual bool itemAvailable() override;
virtual bool addItemToPlaylist(bool play) override;
virtual std::vector<MPD::Song> getSelectedSongs() override;
// HasColumns implementation
virtual bool previousColumnAvailable() OVERRIDE;
virtual void previousColumn() OVERRIDE;
virtual bool previousColumnAvailable() override;
virtual void previousColumn() override;
virtual bool nextColumnAvailable() OVERRIDE;
virtual void nextColumn() OVERRIDE;
virtual bool nextColumnAvailable() override;
virtual void nextColumn() override;
// private members
void updateTimer();

View File

@@ -152,7 +152,7 @@ public:
virtual ~Screen() { }
virtual bool isActiveWindow(const NC::Window &w_) const OVERRIDE {
virtual bool isActiveWindow(const NC::Window &w_) const override {
return &Accessor::constApply(w) == &w_;
}
@@ -160,20 +160,20 @@ public:
/// it's useful to determine the one that is being
/// active
/// @return address to window object cast to void *
virtual NC::Window *activeWindow() OVERRIDE {
virtual NC::Window *activeWindow() override {
return &Accessor::apply(w);
}
virtual const NC::Window *activeWindow() const OVERRIDE {
virtual const NC::Window *activeWindow() const override {
return &Accessor::constApply(w);
}
/// Refreshes whole screen
virtual void refresh() OVERRIDE {
virtual void refresh() override {
Accessor::apply(w).display();
}
/// Refreshes active window of the screen
virtual void refreshWindow() OVERRIDE {
virtual void refreshWindow() override {
Accessor::apply(w).display();
}
@@ -181,20 +181,20 @@ public:
/// if fancy scrolling feature is disabled, enters the
/// loop that holds main loop until user releases the key
/// @param where indicates where one wants to scroll
virtual void scroll(NC::Scroll where) OVERRIDE {
virtual void scroll(NC::Scroll where) override {
Accessor::apply(w).scroll(where);
}
/// @return timeout parameter used for the screen (in ms)
/// @default defaultWindowTimeout
virtual int windowTimeout() OVERRIDE {
virtual int windowTimeout() override {
return defaultWindowTimeout;
}
/// Invoked after there was one of mouse buttons pressed
/// @param me struct that contains coords of where the click
/// had its place and button actions
virtual void mouseButtonPressed(MEVENT me) OVERRIDE {
virtual void mouseButtonPressed(MEVENT me) override {
genericMouseButtonPressed(Accessor::apply(w), me);
}

View File

@@ -36,10 +36,10 @@ struct Scrollpad: public Window
const std::string &title, Color color, Border border);
// override a few Window functions
virtual void refresh() OVERRIDE;
virtual void scroll(Scroll where) OVERRIDE;
virtual void resize(size_t new_width, size_t new_height) OVERRIDE;
virtual void clear() OVERRIDE;
virtual void refresh() override;
virtual void scroll(Scroll where) override;
virtual void resize(size_t new_width, size_t new_height) override;
virtual void clear() override;
const std::string &buffer();

View File

@@ -81,14 +81,14 @@ struct SearchEngineWindow: NC::Menu<SEItem>, SongList
SearchEngineWindow(NC::Menu<SEItem> &&base)
: NC::Menu<SEItem>(std::move(base)) { }
virtual SongIterator currentS() OVERRIDE;
virtual ConstSongIterator currentS() const OVERRIDE;
virtual SongIterator beginS() OVERRIDE;
virtual ConstSongIterator beginS() const OVERRIDE;
virtual SongIterator endS() OVERRIDE;
virtual ConstSongIterator endS() const OVERRIDE;
virtual SongIterator currentS() override;
virtual ConstSongIterator currentS() const override;
virtual SongIterator beginS() override;
virtual ConstSongIterator beginS() const override;
virtual SongIterator endS() override;
virtual ConstSongIterator endS() const override;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() override;
};
struct SearchEngine: Screen<SearchEngineWindow>, Filterable, HasActions, HasSongs, Searchable, Tabbable
@@ -96,39 +96,39 @@ struct SearchEngine: Screen<SearchEngineWindow>, Filterable, HasActions, HasSong
SearchEngine();
// Screen<SearchEngineWindow> implementation
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() override;
virtual void switchTo() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::SearchEngine; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::SearchEngine; }
virtual void update() OVERRIDE { }
virtual void update() override { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// Searchable implementation
virtual bool allowsSearching() OVERRIDE;
virtual const std::string &searchConstraint() OVERRIDE;
virtual void setSearchConstraint(const std::string &constraint) OVERRIDE;
virtual void clearSearchConstraint() OVERRIDE;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) OVERRIDE;
virtual bool allowsSearching() override;
virtual const std::string &searchConstraint() override;
virtual void setSearchConstraint(const std::string &constraint) override;
virtual void clearSearchConstraint() override;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) override;
// Filterable implementation
virtual bool allowsFiltering() OVERRIDE;
virtual std::string currentFilter() OVERRIDE;
virtual void applyFilter(const std::string &filter) OVERRIDE;
virtual bool allowsFiltering() override;
virtual std::string currentFilter() override;
virtual void applyFilter(const std::string &filter) override;
// HasActions implementation
virtual bool actionRunnable() OVERRIDE;
virtual void runAction() OVERRIDE;
virtual bool actionRunnable() override;
virtual void runAction() override;
// HasSongs implementation
virtual bool itemAvailable() OVERRIDE;
virtual bool addItemToPlaylist(bool play) OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual bool itemAvailable() override;
virtual bool addItemToPlaylist(bool play) override;
virtual std::vector<MPD::Song> getSelectedSongs() override;
// private members
void reset();

View File

@@ -35,30 +35,30 @@ struct SelectedItemsAdder: Screen<NC::Menu<RunnableItem<std::string, void()>> *>
SelectedItemsAdder();
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void refresh() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual void refresh() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::SelectedItemsAdder; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::SelectedItemsAdder; }
virtual void update() OVERRIDE { }
virtual void update() override { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return false; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return false; }
// HasActions implementation
virtual bool actionRunnable() OVERRIDE;
virtual void runAction() OVERRIDE;
virtual bool actionRunnable() override;
virtual void runAction() override;
// Searchable implementation
virtual bool allowsSearching() OVERRIDE;
virtual const std::string &searchConstraint() OVERRIDE;
virtual void setSearchConstraint(const std::string &constraint) OVERRIDE;
virtual void clearSearchConstraint() OVERRIDE;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) OVERRIDE;
virtual bool allowsSearching() override;
virtual const std::string &searchConstraint() override;
virtual void setSearchConstraint(const std::string &constraint) override;
virtual void clearSearchConstraint() override;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) override;
private:
void populatePlaylistSelector(BaseScreen *screen);

View File

@@ -31,16 +31,16 @@ struct ServerInfo: Screen<NC::Scrollpad>, Tabbable
ServerInfo();
// Screen<NC::Scrollpad> implementation
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::ServerInfo; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::ServerInfo; }
virtual void update() OVERRIDE;
virtual void update() override;
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return false; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return false; }
private:
void SetDimensions();

View File

@@ -37,16 +37,16 @@ struct SongInfo: Screen<NC::Scrollpad>, Tabbable
SongInfo();
// Screen<NC::Scrollpad> implementation
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::SongInfo; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::SongInfo; }
virtual void update() OVERRIDE { }
virtual void update() override { }
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return true; }
// private members
static const Metadata Tags[];

View File

@@ -65,14 +65,14 @@ struct SongMenu: NC::Menu<MPD::Song>, SongList
SongMenu(NC::Menu<MPD::Song> &&base)
: NC::Menu<MPD::Song>(std::move(base)) { }
virtual SongIterator currentS() OVERRIDE;
virtual ConstSongIterator currentS() const OVERRIDE;
virtual SongIterator beginS() OVERRIDE;
virtual ConstSongIterator beginS() const OVERRIDE;
virtual SongIterator endS() OVERRIDE;
virtual ConstSongIterator endS() const OVERRIDE;
virtual SongIterator currentS() override;
virtual ConstSongIterator currentS() const override;
virtual SongIterator beginS() override;
virtual ConstSongIterator beginS() const override;
virtual SongIterator endS() override;
virtual ConstSongIterator endS() const override;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() override;
};
#endif // NCMPCPP_SONG_LIST_H

View File

@@ -33,22 +33,22 @@ struct SortPlaylistDialog
SortPlaylistDialog();
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::SortPlaylistDialog; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::SortPlaylistDialog; }
virtual void update() OVERRIDE { }
virtual void update() override { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return false; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return false; }
// HasActions implementation
virtual bool actionRunnable() OVERRIDE;
virtual void runAction() OVERRIDE;
virtual bool actionRunnable() override;
virtual void runAction() override;
// private members
void moveSortOrderUp();

View File

@@ -39,56 +39,56 @@ struct TagsWindow: NC::Menu<MPD::MutableSong>, SongList
TagsWindow(NC::Menu<MPD::MutableSong> &&base)
: NC::Menu<MPD::MutableSong>(std::move(base)) { }
virtual SongIterator currentS() OVERRIDE;
virtual ConstSongIterator currentS() const OVERRIDE;
virtual SongIterator beginS() OVERRIDE;
virtual ConstSongIterator beginS() const OVERRIDE;
virtual SongIterator endS() OVERRIDE;
virtual ConstSongIterator endS() const OVERRIDE;
virtual SongIterator currentS() override;
virtual ConstSongIterator currentS() const override;
virtual SongIterator beginS() override;
virtual ConstSongIterator beginS() const override;
virtual SongIterator endS() override;
virtual ConstSongIterator endS() const override;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() override;
};
struct TagEditor: Screen<NC::Window *>, HasActions, HasColumns, HasSongs, Searchable, Tabbable
{
TagEditor();
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() override;
virtual void switchTo() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::TagEditor; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::TagEditor; }
virtual void refresh() OVERRIDE;
virtual void update() OVERRIDE;
virtual void refresh() override;
virtual void update() override;
virtual void mouseButtonPressed(MEVENT) OVERRIDE;
virtual void mouseButtonPressed(MEVENT) override;
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// Searchable implementation
virtual bool allowsSearching() OVERRIDE;
virtual const std::string &searchConstraint() OVERRIDE;
virtual void setSearchConstraint(const std::string &constraint) OVERRIDE;
virtual void clearSearchConstraint() OVERRIDE;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) OVERRIDE;
virtual bool allowsSearching() override;
virtual const std::string &searchConstraint() override;
virtual void setSearchConstraint(const std::string &constraint) override;
virtual void clearSearchConstraint() override;
virtual bool search(SearchDirection direction, bool wrap, bool skip_current) override;
// HasActions implementation
virtual bool actionRunnable() OVERRIDE;
virtual void runAction() OVERRIDE;
virtual bool actionRunnable() override;
virtual void runAction() override;
// HasSongs implementation
virtual bool itemAvailable() OVERRIDE;
virtual bool addItemToPlaylist(bool play) OVERRIDE;
virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
virtual bool itemAvailable() override;
virtual bool addItemToPlaylist(bool play) override;
virtual std::vector<MPD::Song> getSelectedSongs() override;
// HasColumns implementation
virtual bool previousColumnAvailable() OVERRIDE;
virtual void previousColumn() OVERRIDE;
virtual bool previousColumnAvailable() override;
virtual void previousColumn() override;
virtual bool nextColumnAvailable() OVERRIDE;
virtual void nextColumn() OVERRIDE;
virtual bool nextColumnAvailable() override;
virtual void nextColumn() override;
// private members
bool enterDirectory();

View File

@@ -34,22 +34,22 @@ struct TinyTagEditor: Screen<NC::Menu<NC::Buffer>>, HasActions
TinyTagEditor();
// Screen< NC::Menu<NC::Buffer> > implementation
virtual void resize() OVERRIDE;
virtual void switchTo() OVERRIDE;
virtual void resize() override;
virtual void switchTo() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::TinyTagEditor; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::TinyTagEditor; }
virtual void update() OVERRIDE { }
virtual void update() override { }
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) override;
virtual bool isLockable() OVERRIDE { return false; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return false; }
virtual bool isMergable() override { return true; }
// HasActions implementation
virtual bool actionRunnable() OVERRIDE;
virtual void runAction() OVERRIDE;
virtual bool actionRunnable() override;
virtual void runAction() override;
// private members
void SetEdited(const MPD::Song &);

View File

@@ -64,7 +64,7 @@ struct OutOfBounds : std::exception
"value is out of bounds ((<-, %1%] expected, %2% given)") % ubound % value).str());
}
virtual const char *what() const noexcept OVERRIDE { return m_error_message.c_str(); }
virtual const char *what() const noexcept override { return m_error_message.c_str(); }
private:
OutOfBounds(std::string msg) : m_error_message(msg) { }

View File

@@ -38,21 +38,21 @@ struct Visualizer: Screen<NC::Window>, Tabbable
{
Visualizer();
virtual void switchTo() OVERRIDE;
virtual void resize() OVERRIDE;
virtual void switchTo() override;
virtual void resize() override;
virtual std::wstring title() OVERRIDE;
virtual ScreenType type() OVERRIDE { return ScreenType::Visualizer; }
virtual std::wstring title() override;
virtual ScreenType type() override { return ScreenType::Visualizer; }
virtual void update() OVERRIDE;
virtual void scroll(NC::Scroll) OVERRIDE { }
virtual void update() override;
virtual void scroll(NC::Scroll) override { }
virtual int windowTimeout() OVERRIDE;
virtual int windowTimeout() override;
virtual void mouseButtonPressed(MEVENT) OVERRIDE { }
virtual void mouseButtonPressed(MEVENT) override { }
virtual bool isLockable() OVERRIDE { return true; }
virtual bool isMergable() OVERRIDE { return true; }
virtual bool isLockable() override { return true; }
virtual bool isMergable() override { return true; }
// private members
void ToggleVisualizationType();

View File

@@ -137,7 +137,7 @@ struct PromptAborted : std::exception
PromptAborted(ArgT &&prompt)
: m_prompt(std::forward<ArgT>(prompt)) { }
virtual const char *what() const noexcept OVERRIDE { return m_prompt.c_str(); }
virtual const char *what() const noexcept override { return m_prompt.c_str(); }
private:
std::string m_prompt;