Use override

This commit is contained in:
Jonas Kvinge
2020-06-15 21:55:05 +02:00
parent 72ede666d4
commit 651020388d
271 changed files with 1199 additions and 1231 deletions

View File

@@ -62,8 +62,8 @@ class InternetCollectionView : public AutoExpandingTreeView {
void SetFilter(CollectionFilterWidget *filter);
// QTreeView
void keyboardSearch(const QString &search);
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
void keyboardSearch(const QString &search) override;
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
int TotalSongs();
int TotalArtists();
@@ -90,9 +90,9 @@ class InternetCollectionView : public AutoExpandingTreeView {
protected:
// QWidget
void paintEvent(QPaintEvent *event);
void mouseReleaseEvent(QMouseEvent *e);
void contextMenuEvent(QContextMenuEvent *e);
void paintEvent(QPaintEvent *event) override;
void mouseReleaseEvent(QMouseEvent *e) override;
void contextMenuEvent(QContextMenuEvent *e) override;
private slots:
void Load();

View File

@@ -43,7 +43,7 @@ class InternetCollectionViewContainer : public QWidget {
public:
explicit InternetCollectionViewContainer(QWidget *parent = nullptr);
~InternetCollectionViewContainer();
~InternetCollectionViewContainer() override;
QStackedWidget *stacked() const { return ui_->stacked; }
QWidget *help_page() const { return ui_->help_page; }
@@ -58,7 +58,7 @@ class InternetCollectionViewContainer : public QWidget {
void ReloadSettings() { view()->ReloadSettings(); }
private slots:
void contextMenuEvent(QContextMenuEvent *e);
void contextMenuEvent(QContextMenuEvent *e) override;
private:
Ui_InternetCollectionViewContainer *ui_;

View File

@@ -37,14 +37,15 @@ class InternetPlaylistItem : public PlaylistItem {
public:
explicit InternetPlaylistItem(const Song::Source source);
explicit InternetPlaylistItem(InternetService *service, const Song &metadata);
bool InitFromQuery(const SqlRow &query);
Song Metadata() const;
QUrl Url() const;
void SetArtManual(const QUrl &cover_url);
bool InitFromQuery(const SqlRow &query) override;
Song Metadata() const override;
QUrl Url() const override;
void SetArtManual(const QUrl &cover_url) override;
protected:
QVariant DatabaseValue(DatabaseColumn) const;
Song DatabaseSongMetadata() const { return metadata_; }
QVariant DatabaseValue(DatabaseColumn) const override;
Song DatabaseSongMetadata() const override { return metadata_; }
private:
void InitMetadata();

View File

@@ -34,7 +34,7 @@ class InternetSearchItemDelegate : public CollectionItemDelegate {
public:
explicit InternetSearchItemDelegate(InternetSearchView *view);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
private:
InternetSearchView *view_;

View File

@@ -71,7 +71,7 @@ class InternetSearchModel : public QStandardItemModel {
InternetSearchView::ResultList GetChildResults(const QModelIndexList &indexes) const;
InternetSearchView::ResultList GetChildResults(const QList<QStandardItem*> &items) const;
QMimeData *mimeData(const QModelIndexList &indexes) const;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
// Loads tracks for results that were previously emitted by ResultsAvailable.
// The implementation creates a SongMimeData with one Song for each Result.

View File

@@ -31,7 +31,7 @@ class InternetSearchSortModel : public QSortFilterProxyModel {
explicit InternetSearchSortModel(QObject *parent = nullptr);
protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
};
#endif // INTERNETSEARCHSORTMODEL_H

View File

@@ -71,7 +71,7 @@ class InternetSearchView : public QWidget {
public:
explicit InternetSearchView(QWidget *parent = nullptr);
~InternetSearchView();
~InternetSearchView() override;
enum SearchType {
SearchType_Artists = 1,
@@ -104,9 +104,9 @@ class InternetSearchView : public QWidget {
}
};
void showEvent(QShowEvent *e);
bool eventFilter(QObject *object, QEvent *e);
void timerEvent(QTimerEvent *e);
void showEvent(QShowEvent *e) override;
bool eventFilter(QObject *object, QEvent *e) override;
void timerEvent(QTimerEvent *e) override;
// These functions treat queries in the same way as CollectionQuery.
// They're useful for figuring out whether you got a result because it matched in the song title or the artist/album name.

View File

@@ -42,7 +42,7 @@ class InternetService : public QObject {
public:
explicit InternetService(Song::Source source, const QString &name, const QString &url_scheme, const QString &settings_group, SettingsDialog::Page settings_page, Application *app, QObject *parent = nullptr);
virtual ~InternetService() {}
~InternetService() override {}
virtual void Exit() {}
virtual Song::Source source() const { return source_; }

View File

@@ -38,7 +38,7 @@ class InternetServices : public QObject {
public:
explicit InternetServices(QObject *parent = nullptr);
~InternetServices();
~InternetServices() override;
InternetService *ServiceBySource(const Song::Source &source);
template <typename T>

View File

@@ -41,7 +41,7 @@ class InternetSongsView : public QWidget {
public:
explicit InternetSongsView(Application *app, InternetService *service, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent = nullptr);
~InternetSongsView();
~InternetSongsView() override;
void ReloadSettings();

View File

@@ -43,7 +43,7 @@ class InternetTabsView : public QWidget {
public:
explicit InternetTabsView(Application *app, InternetService *service, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent = nullptr);
~InternetTabsView();
~InternetTabsView() override;
void ReloadSettings();

View File

@@ -39,7 +39,7 @@ class LocalRedirectServer : public QTcpServer {
public:
explicit LocalRedirectServer(QObject *parent = nullptr);
~LocalRedirectServer();
~LocalRedirectServer() override;
void set_https(const bool https) { https_ = https; }
void set_port(const int port) { port_ = port; }
@@ -53,7 +53,7 @@ class LocalRedirectServer : public QTcpServer {
public slots:
void NewConnection();
void incomingConnection(qintptr socket_descriptor);
void incomingConnection(qintptr socket_descriptor) override;
void SSLErrors(const QList<QSslError> &errors);
void Encrypted();
void Connected();