Use override
This commit is contained in:
@@ -44,7 +44,7 @@ class SCollection : public QObject {
|
||||
|
||||
public:
|
||||
explicit SCollection(Application *app, QObject *parent);
|
||||
~SCollection();
|
||||
~SCollection() override;
|
||||
|
||||
static const char *kSongsTable;
|
||||
static const char *kDirsTable;
|
||||
|
||||
@@ -61,8 +61,6 @@ CollectionBackend::CollectionBackend(QObject *parent) :
|
||||
|
||||
}
|
||||
|
||||
CollectionBackend::~CollectionBackend() {}
|
||||
|
||||
void CollectionBackend::Init(Database *db, const Song::Source source, const QString &songs_table, const QString &dirs_table, const QString &subdirs_table, const QString &fts_table) {
|
||||
db_ = db;
|
||||
source_ = source;
|
||||
|
||||
@@ -46,7 +46,6 @@ class CollectionBackendInterface : public QObject {
|
||||
|
||||
public:
|
||||
explicit CollectionBackendInterface(QObject *parent = nullptr) : QObject(parent) {}
|
||||
virtual ~CollectionBackendInterface() {}
|
||||
|
||||
struct Album {
|
||||
Album() {}
|
||||
@@ -120,8 +119,7 @@ class CollectionBackend : public CollectionBackendInterface {
|
||||
public:
|
||||
static const char *kSettingsGroup;
|
||||
|
||||
Q_INVOKABLE CollectionBackend(QObject *parent = nullptr);
|
||||
~CollectionBackend();
|
||||
Q_INVOKABLE explicit CollectionBackend(QObject *parent = nullptr);
|
||||
|
||||
void Init(Database *db, const Song::Source source, const QString &songs_table, const QString &dirs_table, const QString &subdirs_table, const QString &fts_table);
|
||||
void Close();
|
||||
@@ -130,49 +128,49 @@ class CollectionBackend : public CollectionBackendInterface {
|
||||
|
||||
Database *db() const { return db_; }
|
||||
|
||||
QString songs_table() const { return songs_table_; }
|
||||
QString songs_table() const override { return songs_table_; }
|
||||
QString dirs_table() const { return dirs_table_; }
|
||||
QString subdirs_table() const { return subdirs_table_; }
|
||||
|
||||
// Get a list of directories in the collection. Emits DirectoriesDiscovered.
|
||||
void LoadDirectoriesAsync();
|
||||
void LoadDirectoriesAsync() override;
|
||||
|
||||
void UpdateTotalSongCountAsync();
|
||||
void UpdateTotalArtistCountAsync();
|
||||
void UpdateTotalAlbumCountAsync();
|
||||
void UpdateTotalSongCountAsync() override;
|
||||
void UpdateTotalArtistCountAsync() override;
|
||||
void UpdateTotalAlbumCountAsync() override;
|
||||
|
||||
SongList FindSongsInDirectory(const int id);
|
||||
SubdirectoryList SubdirsInDirectory(const int id);
|
||||
DirectoryList GetAllDirectories();
|
||||
void ChangeDirPath(const int id, const QString &old_path, const QString &new_path);
|
||||
SongList FindSongsInDirectory(const int id) override;
|
||||
SubdirectoryList SubdirsInDirectory(const int id) override;
|
||||
DirectoryList GetAllDirectories() override;
|
||||
void ChangeDirPath(const int id, const QString &old_path, const QString &new_path) override;
|
||||
|
||||
QStringList GetAll(const QString &column, const QueryOptions &opt = QueryOptions());
|
||||
QStringList GetAllArtists(const QueryOptions &opt = QueryOptions());
|
||||
QStringList GetAllArtistsWithAlbums(const QueryOptions &opt = QueryOptions());
|
||||
SongList GetSongsByAlbum(const QString &album, const QueryOptions &opt = QueryOptions());
|
||||
SongList GetSongs(const QString &artist, const QString &album, const QueryOptions &opt = QueryOptions());
|
||||
QStringList GetAllArtists(const QueryOptions &opt = QueryOptions()) override;
|
||||
QStringList GetAllArtistsWithAlbums(const QueryOptions &opt = QueryOptions()) override;
|
||||
SongList GetSongsByAlbum(const QString &album, const QueryOptions &opt = QueryOptions()) override;
|
||||
SongList GetSongs(const QString &artist, const QString &album, const QueryOptions &opt = QueryOptions()) override;
|
||||
|
||||
SongList GetCompilationSongs(const QString &album, const QueryOptions &opt = QueryOptions());
|
||||
SongList GetCompilationSongs(const QString &album, const QueryOptions &opt = QueryOptions()) override;
|
||||
|
||||
AlbumList GetAllAlbums(const QueryOptions &opt = QueryOptions());
|
||||
AlbumList GetCompilationAlbums(const QueryOptions &opt = QueryOptions());
|
||||
AlbumList GetAlbumsByArtist(const QString &artist, const QueryOptions &opt = QueryOptions());
|
||||
AlbumList GetAllAlbums(const QueryOptions &opt = QueryOptions()) override;
|
||||
AlbumList GetCompilationAlbums(const QueryOptions &opt = QueryOptions()) override;
|
||||
AlbumList GetAlbumsByArtist(const QString &artist, const QueryOptions &opt = QueryOptions()) override;
|
||||
|
||||
void UpdateManualAlbumArtAsync(const QString &artist, const QString &albumartist, const QString &album, const QUrl &cover_url);
|
||||
Album GetAlbumArt(const QString &artist, const QString &albumartist, const QString &album);
|
||||
void UpdateManualAlbumArtAsync(const QString &artist, const QString &albumartist, const QString &album, const QUrl &cover_url) override;
|
||||
Album GetAlbumArt(const QString &artist, const QString &albumartist, const QString &album) override;
|
||||
|
||||
Song GetSongById(const int id);
|
||||
Song GetSongById(const int id) override;
|
||||
SongList GetSongsById(const QList<int> &ids);
|
||||
SongList GetSongsById(const QStringList &ids);
|
||||
SongList GetSongsByForeignId(const QStringList &ids, const QString &table, const QString &column);
|
||||
|
||||
SongList GetSongsByUrl(const QUrl &url);
|
||||
Song GetSongByUrl(const QUrl &url, qint64 beginning = 0);
|
||||
SongList GetSongsByUrl(const QUrl &url) override;
|
||||
Song GetSongByUrl(const QUrl &url, qint64 beginning = 0) override;
|
||||
|
||||
void AddDirectory(const QString &path);
|
||||
void RemoveDirectory(const Directory &dir);
|
||||
void AddDirectory(const QString &path) override;
|
||||
void RemoveDirectory(const Directory &dir) override;
|
||||
|
||||
bool ExecQuery(CollectionQuery *q);
|
||||
bool ExecQuery(CollectionQuery *q) override;
|
||||
SongList ExecCollectionQuery(CollectionQuery *query);
|
||||
|
||||
void IncrementPlayCountAsync(const int id);
|
||||
|
||||
@@ -45,7 +45,7 @@ CollectionDirectoryModel::CollectionDirectoryModel(CollectionBackend *backend, Q
|
||||
|
||||
}
|
||||
|
||||
CollectionDirectoryModel::~CollectionDirectoryModel() {}
|
||||
CollectionDirectoryModel::~CollectionDirectoryModel() = default;
|
||||
|
||||
void CollectionDirectoryModel::DirectoryDiscovered(const Directory &dir) {
|
||||
|
||||
|
||||
@@ -43,13 +43,13 @@ class CollectionDirectoryModel : public QStandardItemModel {
|
||||
|
||||
public:
|
||||
explicit CollectionDirectoryModel(CollectionBackend* backend, QObject *parent = nullptr);
|
||||
~CollectionDirectoryModel();
|
||||
~CollectionDirectoryModel() override;
|
||||
|
||||
// To be called by GUIs
|
||||
void AddDirectory(const QString &path);
|
||||
void RemoveDirectory(const QModelIndex &index);
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
|
||||
private slots:
|
||||
// To be called by the backend
|
||||
|
||||
@@ -49,7 +49,7 @@ class CollectionFilterWidget : public QWidget {
|
||||
|
||||
public:
|
||||
explicit CollectionFilterWidget(QWidget *parent = nullptr);
|
||||
~CollectionFilterWidget();
|
||||
~CollectionFilterWidget() override;
|
||||
|
||||
static const int kFilterDelay = 500; // msec
|
||||
|
||||
@@ -83,14 +83,14 @@ class CollectionFilterWidget : public QWidget {
|
||||
void SetQueryMode(QueryOptions::QueryMode query_mode);
|
||||
void FocusOnFilter(QKeyEvent *e);
|
||||
|
||||
signals:
|
||||
signals:
|
||||
void UpPressed();
|
||||
void DownPressed();
|
||||
void ReturnPressed();
|
||||
void Filter(const QString &text);
|
||||
|
||||
protected:
|
||||
void keyReleaseEvent(QKeyEvent *e);
|
||||
void keyReleaseEvent(QKeyEvent *e) override;
|
||||
|
||||
private slots:
|
||||
void GroupingChanged(const CollectionModel::Grouping &g);
|
||||
|
||||
@@ -37,10 +37,10 @@ class CollectionItemDelegate : public QStyledItemDelegate {
|
||||
|
||||
public:
|
||||
explicit CollectionItemDelegate(QObject *parent);
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
|
||||
public slots:
|
||||
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index);
|
||||
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) override;
|
||||
};
|
||||
|
||||
#endif // COLLECTIONITEMDELEGATE_H
|
||||
|
||||
@@ -64,7 +64,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
|
||||
public:
|
||||
explicit CollectionModel(CollectionBackend *backend, Application *app, QObject *parent = nullptr);
|
||||
~CollectionModel();
|
||||
~CollectionModel() override;
|
||||
|
||||
static const char *kSavedGroupingsSettingsGroup;
|
||||
|
||||
@@ -146,11 +146,11 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
int total_album_count() const { return total_album_count_; }
|
||||
|
||||
// QAbstractItemModel
|
||||
QVariant data(const QModelIndex &idx, const int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &idx) const;
|
||||
QStringList mimeTypes() const;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
||||
bool canFetchMore(const QModelIndex &parent) const;
|
||||
QVariant data(const QModelIndex &idx, const int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex &idx) const override;
|
||||
QStringList mimeTypes() const override;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
|
||||
// Whether or not to use album cover art, if it exists, in the collection view
|
||||
void set_pretty_covers(const bool use_pretty_covers);
|
||||
@@ -199,7 +199,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
void ResetAsync();
|
||||
|
||||
protected:
|
||||
void LazyPopulate(CollectionItem *item) { LazyPopulate(item, true); }
|
||||
void LazyPopulate(CollectionItem *item) override { LazyPopulate(item, true); }
|
||||
void LazyPopulate(CollectionItem *parent, const bool signal);
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -36,25 +36,25 @@ class CollectionPlaylistItem : public PlaylistItem {
|
||||
explicit CollectionPlaylistItem();
|
||||
explicit CollectionPlaylistItem(const Song &song);
|
||||
|
||||
bool InitFromQuery(const SqlRow &query);
|
||||
void Reload();
|
||||
bool InitFromQuery(const SqlRow &query) override;
|
||||
void Reload() override;
|
||||
|
||||
Song Metadata() const;
|
||||
Song Metadata() const override;
|
||||
void SetMetadata(const Song &song) { song_ = song; }
|
||||
|
||||
QUrl Url() const;
|
||||
QUrl Url() const override;
|
||||
|
||||
bool IsLocalCollectionItem() const { return true; }
|
||||
bool IsLocalCollectionItem() const override { return true; }
|
||||
|
||||
void SetArtManual(const QUrl &cover_url);
|
||||
void SetArtManual(const QUrl &cover_url) override;
|
||||
|
||||
protected:
|
||||
QVariant DatabaseValue(DatabaseColumn column) const;
|
||||
Song DatabaseSongMetadata() const { return Song(Song::Source_Collection); }
|
||||
QVariant DatabaseValue(DatabaseColumn column) const override;
|
||||
Song DatabaseSongMetadata() const override { return Song(Song::Source_Collection); }
|
||||
|
||||
protected:
|
||||
Song song_;
|
||||
};
|
||||
|
||||
#endif // COLLECTIONPLAYLISTITEM_H
|
||||
#endif // COLLECTIONPLAYLISTITEM_H
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ CollectionView::CollectionView(QWidget *parent)
|
||||
|
||||
}
|
||||
|
||||
CollectionView::~CollectionView() {}
|
||||
CollectionView::~CollectionView() = default;
|
||||
|
||||
void CollectionView::SaveFocus() {
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class CollectionView : public AutoExpandingTreeView {
|
||||
|
||||
public:
|
||||
explicit CollectionView(QWidget *parent = nullptr);
|
||||
~CollectionView();
|
||||
~CollectionView() override;
|
||||
|
||||
// Returns Songs currently selected in the collection view.
|
||||
// Please note that the selection is recursive meaning that if for example an album is selected this will return all of it's songs.
|
||||
@@ -62,8 +62,8 @@ class CollectionView : 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();
|
||||
@@ -92,9 +92,9 @@ class CollectionView : 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();
|
||||
|
||||
@@ -35,7 +35,7 @@ class CollectionViewContainer : public QWidget {
|
||||
|
||||
public:
|
||||
explicit CollectionViewContainer(QWidget *parent = nullptr);
|
||||
~CollectionViewContainer();
|
||||
~CollectionViewContainer() override;
|
||||
|
||||
CollectionFilterWidget *filter() const;
|
||||
CollectionView *view() const;
|
||||
|
||||
@@ -108,7 +108,7 @@ GroupByDialog::GroupByDialog(QWidget *parent) : QDialog(parent), ui_(new Ui_Grou
|
||||
|
||||
}
|
||||
|
||||
GroupByDialog::~GroupByDialog() {}
|
||||
GroupByDialog::~GroupByDialog() = default;
|
||||
|
||||
void GroupByDialog::Reset() {
|
||||
ui_->combobox_first->setCurrentIndex(2); // Album Artist
|
||||
|
||||
@@ -30,24 +30,24 @@
|
||||
#include <QString>
|
||||
|
||||
#include "collectionmodel.h"
|
||||
#include "ui_groupbydialog.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
class GroupByDialogPrivate;
|
||||
class Ui_GroupByDialog;
|
||||
|
||||
class GroupByDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GroupByDialog(QWidget *parent = nullptr);
|
||||
~GroupByDialog();
|
||||
~GroupByDialog() override;
|
||||
|
||||
public slots:
|
||||
void CollectionGroupingChanged(const CollectionModel::Grouping &g);
|
||||
void accept();
|
||||
void accept() override;
|
||||
|
||||
signals:
|
||||
signals:
|
||||
void Accepted(const CollectionModel::Grouping &g);
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -40,7 +40,7 @@ class SavedGroupingManager : public QDialog {
|
||||
|
||||
public:
|
||||
explicit SavedGroupingManager(QWidget *parent = nullptr);
|
||||
~SavedGroupingManager();
|
||||
~SavedGroupingManager() override;
|
||||
|
||||
void UpdateModel();
|
||||
void SetFilter(CollectionFilterWidget* filter) { filter_ = filter; }
|
||||
|
||||
Reference in New Issue
Block a user