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

@ -108,65 +108,65 @@ class ASF::File::FilePrivate::UnknownObject : public ASF::File::FilePrivate::Bas
public:
explicit UnknownObject(const ByteVector &guid);
ByteVector guid() const;
ByteVector guid() const override;
};
class ASF::File::FilePrivate::FilePropertiesObject : public ASF::File::FilePrivate::BaseObject {
public:
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
};
class ASF::File::FilePrivate::StreamPropertiesObject : public ASF::File::FilePrivate::BaseObject {
public:
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
};
class ASF::File::FilePrivate::ContentDescriptionObject : public ASF::File::FilePrivate::BaseObject {
public:
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
ByteVector render(ASF::File *file) override;
};
class ASF::File::FilePrivate::ExtendedContentDescriptionObject : public ASF::File::FilePrivate::BaseObject {
public:
ByteVectorList attributeData;
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
ByteVector render(ASF::File *file) override;
};
class ASF::File::FilePrivate::MetadataObject : public ASF::File::FilePrivate::BaseObject {
public:
ByteVectorList attributeData;
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
ByteVector render(ASF::File *file) override;
};
class ASF::File::FilePrivate::MetadataLibraryObject : public ASF::File::FilePrivate::BaseObject {
public:
ByteVectorList attributeData;
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
ByteVector render(ASF::File *file) override;
};
class ASF::File::FilePrivate::HeaderExtensionObject : public ASF::File::FilePrivate::BaseObject {
public:
List<ASF::File::FilePrivate::BaseObject *> objects;
HeaderExtensionObject();
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector render(ASF::File *file);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
ByteVector render(ASF::File *file) override;
};
class ASF::File::FilePrivate::CodecListObject : public ASF::File::FilePrivate::BaseObject {
public:
ByteVector guid() const;
void parse(ASF::File *file, unsigned int size);
ByteVector guid() const override;
void parse(ASF::File *file, unsigned int size) override;
private:
enum CodecType {

View File

@ -276,7 +276,7 @@ class FileRef::FileRefPrivate : public RefCounter {
public:
FileRefPrivate() : file(nullptr), stream(nullptr) {}
~FileRefPrivate() {
~FileRefPrivate() override {
delete file;
delete stream;
}

View File

@ -85,9 +85,9 @@ class AdapterFile : public Strawberry_TagLib::TagLib::File {
public:
explicit AdapterFile(IOStream *stream) : File(stream) {}
Tag *tag() const { return nullptr; }
AudioProperties *audioProperties() const { return nullptr; }
bool save() { return false; }
Tag *tag() const override { return nullptr; }
AudioProperties *audioProperties() const override { return nullptr; }
bool save() override { return false; }
};
} // namespace

View File

@ -37,7 +37,7 @@ using namespace Strawberry_TagLib::TagLib;
namespace {
class DefaultListener : public DebugListener {
public:
virtual void printMessage(const String &msg) {
void printMessage(const String &msg) override {
#ifdef _WIN32
const wstring wstr = msg.toWString();

View File

@ -84,13 +84,13 @@ class SkipReader : public Reader {
public:
explicit SkipReader(unsigned int size) : m_size(size) {}
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) {
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) override {
unsigned int count = std::min(m_size, limit);
file.seek(count, Strawberry_TagLib::TagLib::File::Current);
return count;
}
unsigned int size() const {
unsigned int size() const override {
return m_size;
}
@ -111,7 +111,7 @@ class StringReader : public ValueReader<String> {
public:
StringReader(String &string, unsigned int size) : ValueReader<String>(string), m_size(size) {}
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) {
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) override {
ByteVector data = file.readBlock(std::min(m_size, limit));
unsigned int count = data.size();
@ -125,7 +125,7 @@ class StringReader : public ValueReader<String> {
}
unsigned int size() const {
unsigned int size() const override {
return m_size;
}
@ -137,7 +137,7 @@ class ByteReader : public ValueReader<unsigned char> {
public:
explicit ByteReader(unsigned char &_byte) : ValueReader<unsigned char>(_byte) {}
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) {
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) override {
ByteVector data = file.readBlock(std::min(1U, limit));
if (data.size() > 0) {
value = data[0];
@ -145,7 +145,7 @@ class ByteReader : public ValueReader<unsigned char> {
return data.size();
}
unsigned int size() const {
unsigned int size() const override {
return 1;
}
};
@ -165,13 +165,13 @@ class U16Reader : public NumberReader<unsigned short> {
U16Reader(unsigned short &_value, bool _bigEndian)
: NumberReader<unsigned short>(_value, _bigEndian) {}
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) {
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) override {
ByteVector data = file.readBlock(std::min(2U, limit));
value = data.toUShort(bigEndian);
return data.size();
}
unsigned int size() const {
unsigned int size() const override {
return 2;
}
};
@ -181,13 +181,13 @@ class U32Reader : public NumberReader<unsigned long> {
U32Reader(unsigned long &_value, bool _bigEndian = true) : NumberReader<unsigned long>(_value, _bigEndian) {
}
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) {
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) override {
ByteVector data = file.readBlock(std::min(4U, limit));
value = data.toUInt(bigEndian);
return data.size();
}
unsigned int size() const {
unsigned int size() const override {
return 4;
}
};
@ -276,7 +276,7 @@ class StructReader : public Reader {
return u32(number, true);
}
unsigned int size() const {
unsigned int size() const override {
unsigned int size = 0;
for (List<Reader *>::ConstIterator i = m_readers.begin();
i != m_readers.end();
@ -286,7 +286,7 @@ class StructReader : public Reader {
return size;
}
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) {
unsigned int read(Strawberry_TagLib::TagLib::File &file, unsigned int limit) override {
unsigned int sumcount = 0;
for (List<Reader *>::ConstIterator i = m_readers.begin();
limit > 0 && i != m_readers.end();

View File

@ -101,7 +101,7 @@ class FileRefFactory {
class TagLibFileRefFactory : public FileRefFactory {
public:
virtual TagLib::FileRef *GetFileRef(const QString &filename) {
TagLib::FileRef *GetFileRef(const QString &filename) override {
#ifdef Q_OS_WIN32
return new TagLib::FileRef(filename.toStdWString().c_str());
#else

View File

@ -55,7 +55,7 @@ class Base : public QWidget {
Q_OBJECT
public:
~Base() { delete fht_; }
~Base() override { delete fht_; }
uint timeout() const { return timeout_; }
@ -74,10 +74,10 @@ class Base : public QWidget {
protected:
explicit Base(QWidget*, uint scopeSize = 7);
void hideEvent(QHideEvent*);
void showEvent(QShowEvent*);
void paintEvent(QPaintEvent*);
void timerEvent(QTimerEvent*);
void hideEvent(QHideEvent*) override;
void showEvent(QShowEvent*) override;
void paintEvent(QPaintEvent*) override;
void timerEvent(QTimerEvent*) override;
void polishEvent();

View File

@ -44,7 +44,7 @@ class AnalyzerContainer : public QWidget {
Q_OBJECT
public:
AnalyzerContainer(QWidget* parent);
explicit AnalyzerContainer(QWidget *parent);
void SetEngine(EngineBase *engine);
void SetActions(QAction *visualisation);
@ -52,12 +52,12 @@ class AnalyzerContainer : public QWidget {
static const char *kSettingsGroup;
static const char *kSettingsFramerate;
signals:
signals:
void WheelEvent(int delta);
protected:
void mouseReleaseEvent(QMouseEvent*);
void wheelEvent(QWheelEvent *e);
void mouseReleaseEvent(QMouseEvent*) override;
void wheelEvent(QWheelEvent *e) override;
private slots:
void ChangeAnalyzer(int id);

View File

@ -67,8 +67,6 @@ BlockAnalyzer::BlockAnalyzer(QWidget *parent)
}
BlockAnalyzer::~BlockAnalyzer() {}
void BlockAnalyzer::resizeEvent(QResizeEvent *e) {
QWidget::resizeEvent(e);

View File

@ -39,9 +39,9 @@ class QResizeEvent;
class BlockAnalyzer : public Analyzer::Base {
Q_OBJECT
public:
Q_INVOKABLE BlockAnalyzer(QWidget*);
~BlockAnalyzer();
static const uint kHeight;
static const uint kWidth;
@ -53,11 +53,11 @@ class BlockAnalyzer : public Analyzer::Base {
static const char *kName;
protected:
virtual void transform(Analyzer::Scope&);
virtual void analyze(QPainter &p, const Analyzer::Scope&, bool new_frame);
virtual void resizeEvent(QResizeEvent*);
void transform(Analyzer::Scope&) override;
void analyze(QPainter &p, const Analyzer::Scope&, bool new_frame) override;
void resizeEvent(QResizeEvent*) override;
virtual void paletteChange(const QPalette&);
virtual void framerateChanged();
void framerateChanged() override;
void drawBackground();
void determineStep();

View File

@ -44,15 +44,15 @@ class BoomAnalyzer : public Analyzer::Base {
static const char* kName;
virtual void transform(Analyzer::Scope& s);
virtual void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame);
void transform(Analyzer::Scope& s) override;
void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame) override;
public slots:
void changeK_barHeight(int);
void changeF_peakSpeed(int);
protected:
void resizeEvent(QResizeEvent* e);
void resizeEvent(QResizeEvent* e) override;
static const uint kColumnWidth;
static const uint kMaxBandCount;

View File

@ -53,11 +53,11 @@ class RainbowAnalyzer : public Analyzer::Base {
RainbowAnalyzer(const RainbowType& rbtype, QWidget* parent);
protected:
void transform(Analyzer::Scope&);
void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame);
void transform(Analyzer::Scope&) override;
void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame) override;
void timerEvent(QTimerEvent* e);
void resizeEvent(QResizeEvent* e);
void timerEvent(QTimerEvent* e) override;
void resizeEvent(QResizeEvent* e) override;
private:
static const int kHeight[];

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@ CollectionDirectoryModel::CollectionDirectoryModel(CollectionBackend *backend, Q
}
CollectionDirectoryModel::~CollectionDirectoryModel() {}
CollectionDirectoryModel::~CollectionDirectoryModel() = default;
void CollectionDirectoryModel::DirectoryDiscovered(const Directory &dir) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -88,7 +88,7 @@ CollectionView::CollectionView(QWidget *parent)
}
CollectionView::~CollectionView() {}
CollectionView::~CollectionView() = default;
void CollectionView::SaveFocus() {

View File

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

View File

@ -35,7 +35,7 @@ class CollectionViewContainer : public QWidget {
public:
explicit CollectionViewContainer(QWidget *parent = nullptr);
~CollectionViewContainer();
~CollectionViewContainer() override;
CollectionFilterWidget *filter() const;
CollectionView *view() const;

View File

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

View File

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

View File

@ -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; }

View File

@ -52,9 +52,9 @@ class ContextAlbum : public QWidget {
void SetImage(QImage image = QImage());
protected:
void paintEvent(QPaintEvent*);
void contextMenuEvent(QContextMenuEvent *e);
void mouseDoubleClickEvent(QMouseEvent *e);
void paintEvent(QPaintEvent*) override;
void contextMenuEvent(QContextMenuEvent *e) override;
void mouseDoubleClickEvent(QMouseEvent *e) override;
private:
void DrawImage(QPainter *p);

View File

@ -58,7 +58,7 @@ class ContextAlbumsModel : public SimpleTreeModel<CollectionItem> {
public:
explicit ContextAlbumsModel(CollectionBackend *backend, Application *app, QObject *parent = nullptr);
~ContextAlbumsModel();
~ContextAlbumsModel() override;
static const int kPrettyCoverSize;
@ -81,11 +81,11 @@ class ContextAlbumsModel : public SimpleTreeModel<CollectionItem> {
SongList GetChildSongs(const QModelIndex &index) const;
SongList GetChildSongs(const QModelIndexList &indexes) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
QStringList mimeTypes() const;
QMimeData *mimeData(const QModelIndexList &indexes) const;
bool canFetchMore(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool canFetchMore(const QModelIndex &parent) const override;
static QString TextOrUnknown(const QString &text);
static QString SortText(QString text);
@ -96,7 +96,7 @@ class ContextAlbumsModel : public SimpleTreeModel<CollectionItem> {
void AddSongs(const SongList &songs);
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:

View File

@ -134,7 +134,7 @@ ContextAlbumsView::ContextAlbumsView(QWidget *parent)
}
ContextAlbumsView::~ContextAlbumsView() {}
ContextAlbumsView::~ContextAlbumsView() = default;
void ContextAlbumsView::SaveFocus() {

View File

@ -46,9 +46,9 @@ class QMouseEvent;
class QPaintEvent;
class Application;
class ContextAlbumsModel;
class EditTagDialog;
class OrganiseDialog;
class ContextAlbumsModel;
class ContextItemDelegate : public QStyledItemDelegate {
Q_OBJECT
@ -57,7 +57,7 @@ class ContextItemDelegate : public QStyledItemDelegate {
explicit ContextItemDelegate(QObject *parent);
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;
};
class ContextAlbumsView : public AutoExpandingTreeView {
@ -65,7 +65,7 @@ class ContextAlbumsView : public AutoExpandingTreeView {
public:
ContextAlbumsView(QWidget *parent = nullptr);
~ContextAlbumsView();
~ContextAlbumsView() 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.
@ -74,7 +74,7 @@ class ContextAlbumsView : public AutoExpandingTreeView {
void Init(Application *app);
// QTreeView
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
ContextAlbumsModel *albums_model() { return model_; }
@ -84,9 +84,9 @@ class ContextAlbumsView : 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

@ -65,10 +65,10 @@ class ContextView : public QWidget {
Song song_playing() const { return song_playing_; }
protected:
void resizeEvent(QResizeEvent*);
void contextMenuEvent(QContextMenuEvent*);
void dragEnterEvent(QDragEnterEvent*);
void dropEvent(QDropEvent*);
void resizeEvent(QResizeEvent*) override;
void contextMenuEvent(QContextMenuEvent*) override;
void dragEnterEvent(QDragEnterEvent*) override;
void dropEvent(QDropEvent*) override;
private:
void AddActions();

View File

@ -67,7 +67,7 @@ class Application : public QObject {
public:
explicit Application(QObject *parent = nullptr);
~Application();
~Application() override;
TagReaderClient *tag_reader_client() const;
Database *database() const;

View File

@ -43,7 +43,7 @@ class Database : public QObject {
public:
explicit Database(Application *app, QObject *parent = nullptr, const QString &database_name = QString());
~Database();
~Database() override;
struct AttachedDatabase {
AttachedDatabase() {}
@ -131,7 +131,7 @@ class MemoryDatabase : public Database {
public:
MemoryDatabase(Application *app, QObject *parent = nullptr)
: Database(app, parent, ":memory:") {}
~MemoryDatabase() {
~MemoryDatabase() override {
// Make sure Qt doesn't reuse the same database
QSqlDatabase::removeDatabase(Connect().connectionName());
}

View File

@ -32,8 +32,8 @@ class DBusScreensaver : public Screensaver {
public:
explicit DBusScreensaver(const QString &service, const QString &path, const QString &interface);
void Inhibit();
void Uninhibit();
void Inhibit() override;
void Uninhibit() override;
private:
QString service_;

View File

@ -44,7 +44,7 @@ DeleteFiles::DeleteFiles(TaskManager *task_manager, std::shared_ptr<MusicStorage
original_thread_ = thread();
}
DeleteFiles::~DeleteFiles() {}
DeleteFiles::~DeleteFiles() = default;
void DeleteFiles::Start(const SongList &songs) {

View File

@ -39,7 +39,7 @@ class DeleteFiles : public QObject {
public:
explicit DeleteFiles(TaskManager *task_manager, std::shared_ptr<MusicStorage> storage);
~DeleteFiles();
~DeleteFiles() override;
static const int kBatchSize;

View File

@ -31,12 +31,11 @@
class FilesystemMusicStorage : public virtual MusicStorage {
public:
explicit FilesystemMusicStorage(const QString &root);
~FilesystemMusicStorage() {}
QString LocalPath() const { return root_; }
QString LocalPath() const override { return root_; }
bool CopyToStorage(const CopyJob &job);
bool DeleteFromStorage(const DeleteJob &job);
bool CopyToStorage(const CopyJob &job) override;
bool DeleteFromStorage(const DeleteJob &job) override;
private:
QString root_;

View File

@ -28,8 +28,10 @@
class FileSystemWatcherInterface : public QObject {
Q_OBJECT
public:
explicit FileSystemWatcherInterface(QObject *parent = nullptr);
virtual void Init() {}
virtual void AddPath(const QString &path) = 0;
virtual void RemovePath(const QString &path) = 0;
@ -37,7 +39,7 @@ class FileSystemWatcherInterface : public QObject {
static FileSystemWatcherInterface *Create(QObject *parent = nullptr);
signals:
signals:
void PathChanged(const QString &path);
};

View File

@ -101,7 +101,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
public:
explicit MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, const CommandlineOptions& options, QWidget *parent = nullptr);
~MainWindow();
~MainWindow() override;
static const char *kSettingsGroup;
static const char *kAllFilesFilterSpec;
@ -117,13 +117,13 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void CommandlineOptionsReceived(const CommandlineOptions& options);
protected:
void keyPressEvent(QKeyEvent *event);
void closeEvent(QCloseEvent *event);
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
void keyPressEvent(QKeyEvent *event) override;
void closeEvent(QCloseEvent *event) override;
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
// PlatformInterface
void Activate();
bool LoadUrl(const QString& url);
void Activate() override;
bool LoadUrl(const QString& url) override;
signals:
void AlbumCoverReady(const Song &song, const QImage &image);

View File

@ -45,7 +45,7 @@ class MergedProxyModel : public QAbstractProxyModel {
public:
explicit MergedProxyModel(QObject *parent = nullptr);
~MergedProxyModel();
~MergedProxyModel() override;
// Make another model appear as a child of the given item in the source model.
void AddSubModel(const QModelIndex &source_parent, QAbstractItemModel *submodel);
@ -56,33 +56,33 @@ class MergedProxyModel : public QAbstractProxyModel {
QModelIndex FindSourceParent(const QModelIndex &proxy_index) const;
// QAbstractItemModel
QModelIndex index(int row, int column, const QModelIndex &parent) const;
QModelIndex parent(const QModelIndex &child) const;
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &proxy_index, int role = Qt::DisplayRole) const;
bool hasChildren(const QModelIndex &parent) const;
QMap<int, QVariant> itemData(const QModelIndex &proxy_index) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
QStringList mimeTypes() const;
QMimeData *mimeData(const QModelIndexList &indexes) const;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
bool canFetchMore(const QModelIndex &parent) const;
void fetchMore(const QModelIndex &parent);
QModelIndex index(int row, int column, const QModelIndex &parent) const override;
QModelIndex parent(const QModelIndex &child) const override;
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &proxy_index, int role = Qt::DisplayRole) const override;
bool hasChildren(const QModelIndex &parent) const override;
QMap<int, QVariant> itemData(const QModelIndex &proxy_index) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
bool canFetchMore(const QModelIndex &parent) const override;
void fetchMore(const QModelIndex &parent) override;
// QAbstractProxyModel
// Note that these implementations of map{To,From}Source will not always give you an index in sourceModel(),
// you might get an index in one of the child models instead.
QModelIndex mapFromSource(const QModelIndex &source_index) const;
QModelIndex mapToSource(const QModelIndex &proxy_index) const;
void setSourceModel(QAbstractItemModel *source_model);
QModelIndex mapFromSource(const QModelIndex &source_index) const override;
QModelIndex mapToSource(const QModelIndex &proxy_index) const override;
void setSourceModel(QAbstractItemModel *source_model) override;
// Convenience functions that call map{To,From}Source multiple times.
QModelIndexList mapFromSource(const QModelIndexList &source_indexes) const;
QModelIndexList mapToSource(const QModelIndexList &proxy_indexes) const;
signals:
signals:
void SubModelReset(const QModelIndex &root, QAbstractItemModel *model);
private slots:

View File

@ -37,7 +37,7 @@ class MultiSortFilterProxy : public QSortFilterProxyModel {
void AddSortSpec(int role, Qt::SortOrder order = Qt::AscendingOrder);
protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
private:
int Compare(const QVariant &left, const QVariant &right) const;

View File

@ -20,4 +20,4 @@
#include "musicstorage.h"
MusicStorage::MusicStorage() {}
MusicStorage::MusicStorage() = default;

View File

@ -37,7 +37,7 @@
class MusicStorage {
public:
explicit MusicStorage();
virtual ~MusicStorage() {}
virtual ~MusicStorage() = default;
enum Role {
Role_Storage = Qt::UserRole + 100,

View File

@ -44,23 +44,23 @@ class NetworkAccessManager : public QNetworkAccessManager {
explicit NetworkAccessManager(QObject *parent = nullptr);
protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData);
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) override;
};
class ThreadSafeNetworkDiskCache : public QAbstractNetworkCache {
public:
explicit ThreadSafeNetworkDiskCache(QObject *parent);
~ThreadSafeNetworkDiskCache();
~ThreadSafeNetworkDiskCache() override;
qint64 cacheSize() const;
QIODevice *data(const QUrl &url);
void insert(QIODevice *device);
QNetworkCacheMetaData metaData(const QUrl &url);
QIODevice *prepare(const QNetworkCacheMetaData &metaData);
bool remove(const QUrl &url);
void updateMetaData(const QNetworkCacheMetaData &metaData);
qint64 cacheSize() const override;
QIODevice *data(const QUrl &url) override;
void insert(QIODevice *device) override;
QNetworkCacheMetaData metaData(const QUrl &url) override;
QIODevice *prepare(const QNetworkCacheMetaData &metaData) override;
bool remove(const QUrl &url) override;
void updateMetaData(const QNetworkCacheMetaData &metaData) override;
void clear();
void clear() override;
private:
static QMutex sMutex;

View File

@ -41,7 +41,7 @@ class NetworkProxyFactory : public QNetworkProxyFactory {
// These methods are thread-safe
void ReloadSettings();
QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query);
QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query) override;
private:
explicit NetworkProxyFactory();

View File

@ -40,7 +40,7 @@ class NetworkTimeouts : public QObject {
void SetTimeout(int msec) { timeout_msec_ = msec; }
protected:
void timerEvent(QTimerEvent *e);
void timerEvent(QTimerEvent *e) override;
private slots:
void ReplyFinished();

View File

@ -130,23 +130,23 @@ class Player : public PlayerInterface {
Q_OBJECT
public:
Player(Application *app, QObject *parent);
~Player();
explicit Player(Application *app, QObject *parent);
~Player() override;
static const char *kSettingsGroup;
Engine::EngineType CreateEngine(Engine::EngineType enginetype);
void Init();
EngineBase *engine() const { return engine_.get(); }
Engine::State GetState() const { return last_state_; }
int GetVolume() const;
EngineBase *engine() const override { return engine_.get(); }
Engine::State GetState() const override{ return last_state_; }
int GetVolume() const override;
PlaylistItemPtr GetCurrentItem() const { return current_item_; }
PlaylistItemPtr GetItemAt(int pos) const;
PlaylistItemPtr GetCurrentItem() const override { return current_item_; }
PlaylistItemPtr GetItemAt(int pos) const override;
void RegisterUrlHandler(UrlHandler *handler);
void UnregisterUrlHandler(UrlHandler *handler);
void RegisterUrlHandler(UrlHandler *handler) override;
void UnregisterUrlHandler(UrlHandler *handler) override;
const UrlHandler *HandlerForUrl(const QUrl &url) const;
@ -156,29 +156,29 @@ class Player : public PlayerInterface {
void SetEqualizer(Equalizer *equalizer) { equalizer_ = equalizer; }
public slots:
void ReloadSettings();
void ReloadSettings() override;
void PlayAt(int i, Engine::TrackChangeFlags change, bool reshuffle);
void PlayPause();
void RestartOrPrevious();
void Next();
void Previous();
void SetVolume(int value);
void VolumeUp() { SetVolume(GetVolume() + 5); }
void VolumeDown() { SetVolume(GetVolume() - 5); }
void SeekTo(int seconds);
void SeekForward();
void SeekBackward();
void PlayAt(int i, Engine::TrackChangeFlags change, bool reshuffle) override;
void PlayPause() override;
void RestartOrPrevious() override;
void Next() override;
void Previous() override;
void SetVolume(int value) override;
void VolumeUp() override { SetVolume(GetVolume() + 5); }
void VolumeDown() override { SetVolume(GetVolume() - 5); }
void SeekTo(int seconds) override;
void SeekForward() override;
void SeekBackward() override;
void CurrentMetadataChanged(const Song &metadata);
void CurrentMetadataChanged(const Song &metadata) override;
void Mute();
void Pause();
void Stop(bool stop_after = false);
void Mute() override;
void Pause() override;
void Stop(bool stop_after = false) override;
void StopAfterCurrent();
void IntroPointReached();
void Play();
void ShowOSD();
void Play() override;
void ShowOSD() override;
void TogglePrettyOSD();
void HandleAuthentication();

View File

@ -28,7 +28,7 @@
class PoTranslator : public QTranslator {
public:
QString translate(const char *context, const char *source_text, const char *disambiguation = 0, int n = -1) const {
QString translate(const char *context, const char *source_text, const char *disambiguation = 0, int n = -1) const override {
Q_UNUSED(n);
QString ret = QTranslator::translate(context, source_text, disambiguation);
if (!ret.isEmpty()) return ret;

View File

@ -31,11 +31,12 @@
class QtFSListener : public FileSystemWatcherInterface {
Q_OBJECT
public:
explicit QtFSListener(QObject *parent);
virtual void AddPath(const QString &path);
virtual void RemovePath(const QString &path);
virtual void Clear();
void AddPath(const QString &path) override;
void RemovePath(const QString &path) override;
void Clear() override;
private:
QFileSystemWatcher watcher_;

View File

@ -44,32 +44,32 @@ class QtSystemTrayIcon : public SystemTrayIcon {
public:
QtSystemTrayIcon(QObject *parent = nullptr);
~QtSystemTrayIcon();
~QtSystemTrayIcon() override;
void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit);
bool IsVisible() const;
void SetVisible(bool visible);
void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit) override;
bool IsVisible() const override;
void SetVisible(bool visible) override;
void ShowPopup(const QString &summary, const QString &message, int timeout);
void ShowPopup(const QString &summary, const QString &message, int timeout) override;
void SetNowPlaying(const Song &song, const QUrl &cover_url);
void ClearNowPlaying();
void SetNowPlaying(const Song &song, const QUrl &cover_url) override;
void ClearNowPlaying() override;
bool MuteEnabled() { return action_mute_->isVisible(); }
void SetMuteEnabled(bool enabled) { action_mute_->setVisible(enabled); }
bool MuteEnabled() const override { return action_mute_->isVisible(); }
void SetMuteEnabled(bool enabled) override { action_mute_->setVisible(enabled); }
protected:
// SystemTrayIcon
void UpdateIcon();
void SetPaused();
void SetPlaying(bool enable_play_pause = false);
void SetStopped();
void MuteButtonStateChanged(bool value);
void LoveVisibilityChanged(bool value);
void LoveStateChanged(bool value);
void UpdateIcon() override;
void SetPaused() override;
void SetPlaying(bool enable_play_pause = false) override;
void SetStopped() override;
void MuteButtonStateChanged(bool value) override;
void LoveVisibilityChanged(bool value) override;
void LoveStateChanged(bool value) override;
// QObject
bool eventFilter(QObject *, QEvent *);
bool eventFilter(QObject*, QEvent*) override;
private slots:
void Clicked(QSystemTrayIcon::ActivationReason);

View File

@ -46,17 +46,17 @@ class DefaultSettingsProvider : public SettingsProvider {
public:
DefaultSettingsProvider();
void set_group(const char* group);
void set_group(const char* group) override;
QVariant value(const QString &key, const QVariant &default_value = QVariant()) const;
void setValue(const QString &key, const QVariant &value);
int beginReadArray(const QString &prefix);
void beginWriteArray(const QString &prefix, int size = -1);
void setArrayIndex(int i);
void endArray();
QVariant value(const QString &key, const QVariant &default_value = QVariant()) const override;
void setValue(const QString &key, const QVariant &value) override;
int beginReadArray(const QString &prefix) override;
void beginWriteArray(const QString &prefix, int size = -1) override;
void setArrayIndex(int i) override;
void endArray() override;
private:
QSettings backend_;
};
#endif // SETTINGSPROVIDER_H
#endif // SETTINGSPROVIDER_H

View File

@ -29,17 +29,17 @@
template <typename T>
class SimpleTreeModel : public QAbstractItemModel {
public:
explicit SimpleTreeModel(T *root = 0, QObject *parent = nullptr);
virtual ~SimpleTreeModel() {}
explicit SimpleTreeModel(T *root = nullptr, QObject *parent = nullptr);
~SimpleTreeModel() override {}
// QAbstractItemModel
int columnCount(const QModelIndex &parent) const;
QModelIndex index(int row, int, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent) const;
bool hasChildren(const QModelIndex &parent) const;
bool canFetchMore(const QModelIndex &parent) const;
void fetchMore(const QModelIndex &parent);
int columnCount(const QModelIndex &parent) const override;
QModelIndex index(int row, int, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
int rowCount(const QModelIndex &parent) const override;
bool hasChildren(const QModelIndex &parent) const override;
bool canFetchMore(const QModelIndex &parent) const override;
void fetchMore(const QModelIndex &parent) override;
T *IndexToItem(const QModelIndex &index) const;
QModelIndex ItemToIndex(T *item) const;

View File

@ -58,7 +58,7 @@ class SongLoader : public QObject {
Q_OBJECT
public:
explicit SongLoader(CollectionBackendInterface *collection, const Player *player, QObject *parent = nullptr);
~SongLoader();
~SongLoader() override;
enum Result {
Success,

View File

@ -46,7 +46,7 @@ class StyleSheetLoader : public QObject {
void SetStyleSheet(QWidget *widget, const QString& filename);
protected:
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) override;
private:
struct StyleSheetData {

View File

@ -50,7 +50,7 @@ class SystemTrayIcon : public QObject {
virtual void SetNowPlaying(const Song &song, const QUrl &cover_url) { Q_UNUSED(song); Q_UNUSED(cover_url); }
virtual void ClearNowPlaying() {}
virtual bool MuteEnabled() { return false; }
virtual bool MuteEnabled() const { return false; }
virtual void SetMuteEnabled(bool enabled) { Q_UNUSED(enabled); }
static SystemTrayIcon *CreateSystemTrayIcon(QObject *parent = nullptr);

View File

@ -34,7 +34,7 @@ class Thread : public QThread {
void SetIoPriority(Utilities::IoPriority priority) {
io_priority_ = priority;
}
virtual void run() override;
void run() override;
private:
Utilities::IoPriority io_priority_;

View File

@ -28,7 +28,7 @@ class QTranslator;
class Translations : public QObject {
public:
explicit Translations();
~Translations();
~Translations() override;
void LoadTranslation(const QString &prefix, const QString &path, const QString &language);
private:

View File

@ -58,7 +58,7 @@ class AlbumCoverChoiceController : public QWidget {
static const char *kAllFilesFilter;
explicit AlbumCoverChoiceController(QWidget *parent = nullptr);
~AlbumCoverChoiceController();
~AlbumCoverChoiceController() override;
void Init(Application *app);
void ReloadSettings();

View File

@ -36,7 +36,7 @@ class AlbumCoverExport : public QDialog {
public:
explicit AlbumCoverExport(QWidget *parent = nullptr);
~AlbumCoverExport();
~AlbumCoverExport() override;
enum OverwriteMode {
OverwriteMode_None = 0,

View File

@ -38,7 +38,6 @@ class AlbumCoverExporter : public QObject {
public:
explicit AlbumCoverExporter(QObject *parent = nullptr);
virtual ~AlbumCoverExporter() {}
static const int kMaxConcurrentRequests;

View File

@ -89,7 +89,7 @@ class AlbumCoverFetcher : public QObject {
public:
explicit AlbumCoverFetcher(CoverProviders *cover_providers, QObject *parent = nullptr, QNetworkAccessManager *network = 0);
~AlbumCoverFetcher();
~AlbumCoverFetcher() override;
static const int kMaxConcurrentRequests;

View File

@ -50,7 +50,7 @@ class AlbumCoverFetcherSearch : public QObject {
public:
explicit AlbumCoverFetcherSearch(const CoverSearchRequest &request, QNetworkAccessManager *network, QObject *parent);
~AlbumCoverFetcherSearch();
~AlbumCoverFetcherSearch() override;
void Start(CoverProviders *cover_providers);

View File

@ -64,7 +64,7 @@ class AlbumCoverManager : public QMainWindow {
Q_OBJECT
public:
explicit AlbumCoverManager(Application *app, CollectionBackend *collection_backend, QMainWindow *mainwindow, QWidget *parent = nullptr);
~AlbumCoverManager();
~AlbumCoverManager() override;
static const char *kSettingsGroup;
@ -83,11 +83,11 @@ class AlbumCoverManager : public QMainWindow {
SongMimeData *GetMimeDataForAlbums(const QModelIndexList &indexes) const;
protected:
void showEvent(QShowEvent*);
void closeEvent(QCloseEvent*);
void showEvent(QShowEvent*) override;
void closeEvent(QCloseEvent*) override;
// For the album view context menu events
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) override;
private:
enum ArtistItemType {

View File

@ -43,8 +43,8 @@ class AlbumCoverManagerList : public QListWidget {
void set_cover_manager(AlbumCoverManager *manager) { manager_ = manager; }
protected:
QMimeData *mimeData(const QList<QListWidgetItem*> items) const;
void dropEvent(QDropEvent *event);
QMimeData *mimeData(const QList<QListWidgetItem*> items) const override;
void dropEvent(QDropEvent *event) override;
private:
AlbumCoverManager* manager_;

View File

@ -60,7 +60,7 @@ class SizeOverlayDelegate : public QStyledItemDelegate {
explicit SizeOverlayDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};
// This is a dialog that lets the user search for album covers
@ -69,7 +69,7 @@ class AlbumCoverSearcher : public QDialog {
public:
explicit AlbumCoverSearcher(const QIcon &no_cover_icon, Application *app, QWidget *parent);
~AlbumCoverSearcher();
~AlbumCoverSearcher() override;
enum Role {
Role_ImageURL = Qt::UserRole + 1,
@ -84,7 +84,7 @@ class AlbumCoverSearcher : public QDialog {
QImage Exec(const QString &artist, const QString &album);
protected:
void keyPressEvent(QKeyEvent*);
void keyPressEvent(QKeyEvent*) override;
private slots:
void Search();

View File

@ -35,11 +35,10 @@ class CoverExportRunnable : public QObject, public QRunnable {
public:
explicit CoverExportRunnable(const AlbumCoverExport::DialogResult &dialog_result, const Song &song);
virtual ~CoverExportRunnable() {}
void run();
void run() override;
signals:
signals:
void CoverExported();
void CoverSkipped();

View File

@ -39,13 +39,13 @@ class CoverFromURLDialog : public QDialog {
public:
explicit CoverFromURLDialog(QWidget *parent = nullptr);
~CoverFromURLDialog();
~CoverFromURLDialog() override;
// Opens the dialog. This returns an image found at the URL chosen by user or null image if the dialog got rejected.
QImage Exec();
private slots:
void accept();
void accept() override;
void LoadCoverFromURLFinished();
private:

View File

@ -41,7 +41,7 @@ class CoverProviders : public QObject {
public:
explicit CoverProviders(QObject *parent = nullptr);
~CoverProviders();
~CoverProviders() override;
void ReloadSettings();

View File

@ -38,7 +38,7 @@ class CoverSearchStatisticsDialog : public QDialog {
public:
explicit CoverSearchStatisticsDialog(QWidget *parent = nullptr);
~CoverSearchStatisticsDialog();
~CoverSearchStatisticsDialog() override;
void Show(const CoverSearchStatistics& statistics);

View File

@ -43,7 +43,7 @@ class CurrentAlbumCoverLoader : public QObject {
public:
explicit CurrentAlbumCoverLoader(Application *app, QObject *parent = nullptr);
~CurrentAlbumCoverLoader();
~CurrentAlbumCoverLoader() override;
const AlbumCoverLoaderOptions &options() const { return options_; }
const Song &last_song() const { return last_song_; }

View File

@ -41,10 +41,10 @@ class DeezerCoverProvider : public JsonCoverProvider {
public:
explicit DeezerCoverProvider(Application *app, QObject *parent = nullptr);
~DeezerCoverProvider();
~DeezerCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
void CancelSearch(const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
void CancelSearch(const int id) override;
private slots:
void HandleSearchReply(QNetworkReply *reply, const int id);
@ -52,7 +52,7 @@ class DeezerCoverProvider : public JsonCoverProvider {
private:
QByteArray GetReplyData(QNetworkReply *reply);
QJsonValue ExtractData(const QByteArray &data);
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private:
static const char *kApiUrl;

View File

@ -50,10 +50,10 @@ class DiscogsCoverProvider : public JsonCoverProvider {
public:
explicit DiscogsCoverProvider(Application *app, QObject *parent = nullptr);
~DiscogsCoverProvider();
~DiscogsCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
void CancelSearch(const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
void CancelSearch(const int id) override;
enum DiscogsCoverType {
DiscogsCoverType_Master,
@ -86,7 +86,7 @@ class DiscogsCoverProvider : public JsonCoverProvider {
QByteArray GetReplyData(QNetworkReply *reply);
void StartReleaseRequest(std::shared_ptr<DiscogsCoverSearchContext> search, const quint64 release_id, const QUrl &url);
void EndSearch(std::shared_ptr<DiscogsCoverSearchContext> search, const quint64 release_id = 0);
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private slots:
void FlushRequests();

View File

@ -40,9 +40,9 @@ class LastFmCoverProvider : public JsonCoverProvider {
public:
explicit LastFmCoverProvider(Application *app, QObject *parent = nullptr);
~LastFmCoverProvider();
~LastFmCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
private slots:
void QueryFinished(QNetworkReply *reply, const int id, const QString &type);
@ -58,7 +58,7 @@ class LastFmCoverProvider : public JsonCoverProvider {
QByteArray GetReplyData(QNetworkReply *reply);
LastFmImageSize ImageSizeFromString(const QString &size);
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private:
static const char *kUrl;

View File

@ -42,9 +42,9 @@ class MusicbrainzCoverProvider : public JsonCoverProvider {
public:
explicit MusicbrainzCoverProvider(Application *app, QObject *parent = nullptr);
~MusicbrainzCoverProvider();
~MusicbrainzCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
private slots:
void FlushRequests();
@ -60,7 +60,7 @@ class MusicbrainzCoverProvider : public JsonCoverProvider {
void SendSearchRequest(const SearchRequest &request);
QByteArray GetReplyData(QNetworkReply *reply);
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private:
static const char *kReleaseSearchUrl;

View File

@ -38,13 +38,13 @@ class MusixmatchCoverProvider : public JsonCoverProvider {
public:
explicit MusixmatchCoverProvider(Application *app, QObject *parent = nullptr);
~MusixmatchCoverProvider();
~MusixmatchCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
void CancelSearch(const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
void CancelSearch(const int id) override;
private:
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private slots:
void HandleSearchReply(QNetworkReply *reply, const int id, const QString &artist, const QString &album);

View File

@ -40,17 +40,17 @@ class QobuzCoverProvider : public JsonCoverProvider {
public:
explicit QobuzCoverProvider(Application *app, QObject *parent = nullptr);
~QobuzCoverProvider();
~QobuzCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
void CancelSearch(const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
void CancelSearch(const int id) override;
private slots:
void HandleSearchReply(QNetworkReply *reply, const int id);
private:
QByteArray GetReplyData(QNetworkReply *reply);
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private:
static const char *kApiUrl;

View File

@ -46,14 +46,14 @@ class SpotifyCoverProvider : public JsonCoverProvider {
public:
explicit SpotifyCoverProvider(Application *app, QObject *parent = nullptr);
~SpotifyCoverProvider();
~SpotifyCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
void CancelSearch(const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
void CancelSearch(const int id) override;
void Authenticate();
void Deauthenticate();
bool IsAuthenticated() const { return !access_token_.isEmpty(); }
void Authenticate() override;
void Deauthenticate() override;
bool IsAuthenticated() const override { return !access_token_.isEmpty(); }
private slots:
void HandleLoginSSLErrors(QList<QSslError> ssl_errors);
@ -65,7 +65,7 @@ class SpotifyCoverProvider : public JsonCoverProvider {
private:
QByteArray GetReplyData(QNetworkReply *reply);
void AuthError(const QString &error = QString(), const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private:
typedef QPair<QString, QString> Param;

View File

@ -44,20 +44,20 @@ class TidalCoverProvider : public JsonCoverProvider {
public:
explicit TidalCoverProvider(Application *app, QObject *parent = nullptr);
~TidalCoverProvider();
~TidalCoverProvider() override;
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id);
void CancelSearch(const int id);
bool StartSearch(const QString &artist, const QString &album, const QString &title, const int id) override;
void CancelSearch(const int id) override;
bool IsAuthenticated() const { return service_ && service_->authenticated(); }
void Deauthenticate() { if (service_) service_->Logout(); }
bool IsAuthenticated() const override { return service_ && service_->authenticated(); }
void Deauthenticate() override { if (service_) service_->Logout(); }
private slots:
void HandleSearchReply(QNetworkReply *reply, const int id);
private:
QByteArray GetReplyData(QNetworkReply *reply);
void Error(const QString &error, const QVariant &debug = QVariant());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
private:
static const char *kApiUrl;

View File

@ -42,8 +42,6 @@ CddaDevice::CddaDevice(const QUrl &url, DeviceLister *lister, const QString &uni
}
CddaDevice::~CddaDevice() {}
bool CddaDevice::Init() {
song_count_ = 0; // Reset song count, in case it was already set

View File

@ -45,17 +45,16 @@ class CddaDevice : public ConnectedDevice {
Q_OBJECT
public:
Q_INVOKABLE CddaDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time);
~CddaDevice();
Q_INVOKABLE explicit CddaDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time);
bool Init();
void Refresh();
bool CopyToStorage(const MusicStorage::CopyJob&) { return false; }
bool DeleteFromStorage(const MusicStorage::DeleteJob&) { return false; }
bool Init() override;
void Refresh() override;
bool CopyToStorage(const MusicStorage::CopyJob&) override { return false; }
bool DeleteFromStorage(const MusicStorage::DeleteJob&) override { return false; }
static QStringList url_schemes() { return QStringList() << "cdda"; }
signals:
signals:
void SongsDiscovered(const SongList &songs);
private slots:

View File

@ -39,20 +39,20 @@ class CddaLister : public DeviceLister {
public:
explicit CddaLister() {}
QStringList DeviceUniqueIDs();
QVariantList DeviceIcons(const QString &id);
QString DeviceManufacturer(const QString &id);
QString DeviceModel(const QString &id);
quint64 DeviceCapacity(const QString &id);
quint64 DeviceFreeSpace(const QString &id);
QVariantMap DeviceHardwareInfo(const QString &id);
bool AskForScan(const QString&) const { return false; }
QString MakeFriendlyName(const QString&);
QList<QUrl> MakeDeviceUrls(const QString&);
void UnmountDevice(const QString&);
void UpdateDeviceFreeSpace(const QString&);
bool Init();
bool CopyMusic() { return false; }
QStringList DeviceUniqueIDs() override;
QVariantList DeviceIcons(const QString &id) override;
QString DeviceManufacturer(const QString &id) override;
QString DeviceModel(const QString &id) override;
quint64 DeviceCapacity(const QString &id) override;
quint64 DeviceFreeSpace(const QString &id) override;
QVariantMap DeviceHardwareInfo(const QString &id) override;
bool AskForScan(const QString&) const override { return false; }
QString MakeFriendlyName(const QString&) override;
QList<QUrl> MakeDeviceUrls(const QString&) override;
void UnmountDevice(const QString&) override;
void UpdateDeviceFreeSpace(const QString&) override;
bool Init() override;
bool CopyMusic() override { return false; }
private:
QStringList devices_list_;

View File

@ -45,7 +45,7 @@ class CddaSongLoader : public QObject {
public:
explicit CddaSongLoader(const QUrl &url = QUrl(), QObject *parent = nullptr);
~CddaSongLoader();
~CddaSongLoader() override;
// Load songs. Signals declared below will be emitted anytime new information will be available.
void LoadSongs();

View File

@ -44,7 +44,7 @@ class ConnectedDevice : public QObject, public virtual MusicStorage, public std:
public:
explicit ConnectedDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time);
~ConnectedDevice();
~ConnectedDevice() override;
virtual bool Init() = 0;
virtual bool IsLoading() { return false; }
@ -54,8 +54,8 @@ class ConnectedDevice : public QObject, public virtual MusicStorage, public std:
// we can call this method to refresh device's state
virtual void Refresh() {}
virtual TranscodeMode GetTranscodeMode() const;
virtual Song::FileType GetTranscodeFormat() const;
TranscodeMode GetTranscodeMode() const override;
Song::FileType GetTranscodeFormat() const override;
DeviceLister *lister() const { return lister_; }
QString unique_id() const { return unique_id_; }
@ -63,10 +63,10 @@ class ConnectedDevice : public QObject, public virtual MusicStorage, public std:
QUrl url() const { return url_; }
int song_count() const { return song_count_; }
virtual void FinishCopy(bool success);
virtual void FinishDelete(bool success);
void FinishCopy(bool success) override;
void FinishDelete(bool success) override;
virtual void Eject();
void Eject() override;
virtual void Close();
public slots:

View File

@ -49,8 +49,6 @@ DeviceDatabaseBackend::DeviceDatabaseBackend(QObject *parent) :
}
DeviceDatabaseBackend::~DeviceDatabaseBackend() {}
void DeviceDatabaseBackend::Init(Database* db) { db_ = db; }
void DeviceDatabaseBackend::Close() {

View File

@ -39,7 +39,6 @@ class DeviceDatabaseBackend : public QObject {
public:
Q_INVOKABLE DeviceDatabaseBackend(QObject *parent = nullptr);
~DeviceDatabaseBackend();
struct Device {
Device() : id_(-1) {}

View File

@ -38,7 +38,7 @@ class DeviceLister : public QObject {
public:
DeviceLister();
virtual ~DeviceLister();
~DeviceLister() override;
// Tries to start the thread and initialise the engine. This object will be moved to the new thread.
void Start();

View File

@ -59,7 +59,7 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
public:
explicit DeviceManager(Application *app, QObject *parent = nullptr);
~DeviceManager();
~DeviceManager() override;
enum Role {
Role_State = CollectionModel::LastRole,
@ -113,7 +113,7 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
void SetDeviceOptions(QModelIndex idx, const QString &friendly_name, const QString &icon_name, MusicStorage::TranscodeMode mode, Song::FileType format);
// QAbstractItemModel
QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const override;
public slots:
void Unmount(QModelIndex idx);
@ -140,11 +140,10 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
void DeviceDestroyed();
protected:
void LazyPopulate(DeviceInfo *item) { LazyPopulate(item, true); }
void LazyPopulate(DeviceInfo *item) override { LazyPopulate(item, true); }
void LazyPopulate(DeviceInfo *parent, const bool signal);
private:
void AddLister(DeviceLister *lister);
template <typename T> void AddDeviceClass();

View File

@ -43,13 +43,13 @@ class DeviceProperties : public QDialog {
public:
explicit DeviceProperties(QWidget *parent = nullptr);
~DeviceProperties();
~DeviceProperties() override;
void SetDeviceManager(DeviceManager *manager);
void ShowDevice(QModelIndex idx);
public slots:
void accept();
void accept() override;
private:
void UpdateHardwareInfo();

View File

@ -38,13 +38,13 @@ class DeviceStateFilterModel : public QSortFilterProxyModel {
public:
explicit DeviceStateFilterModel(QObject *parent, DeviceManager::State state = DeviceManager::State_Remembered);
void setSourceModel(QAbstractItemModel *sourceModel);
void setSourceModel(QAbstractItemModel *sourceModel) override;
signals:
void IsEmptyChanged(bool is_empty);
protected:
bool filterAcceptsRow(int row, const QModelIndex &parent) const;
bool filterAcceptsRow(int row, const QModelIndex &parent) const override;
private slots:
void ProxyRowCountChanged();

View File

@ -189,7 +189,7 @@ DeviceView::DeviceView(QWidget *parent)
setSelectionMode(QAbstractItemView::ExtendedSelection);
}
DeviceView::~DeviceView() {}
DeviceView::~DeviceView() = default;
void DeviceView::SetApplication(Application *app) {

View File

@ -57,7 +57,7 @@ class DeviceItemDelegate : public CollectionItemDelegate {
static const int kIconPadding;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};
@ -66,13 +66,13 @@ class DeviceView : public AutoExpandingTreeView {
public:
explicit DeviceView(QWidget *parent = nullptr);
~DeviceView();
~DeviceView() override;
void SetApplication(Application *app);
protected:
void contextMenuEvent(QContextMenuEvent*);
void mouseDoubleClickEvent(QMouseEvent *event);
void contextMenuEvent(QContextMenuEvent*) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
private slots:
// Device menu actions
@ -94,7 +94,7 @@ class DeviceView : public AutoExpandingTreeView {
void DeleteFinished(const SongList &songs_with_errors);
// AutoExpandingTreeView
bool CanRecursivelyExpand(const QModelIndex &idx) const;
bool CanRecursivelyExpand(const QModelIndex &idx) const override;
private:
QModelIndex MapToDevice(const QModelIndex &merged_model_index) const;

View File

@ -35,7 +35,7 @@ class DeviceViewContainer : public QWidget {
public:
explicit DeviceViewContainer(QWidget *parent = nullptr);
~DeviceViewContainer();
~DeviceViewContainer() override;
DeviceView *view() const;

View File

@ -47,15 +47,15 @@ public:
const QString &unique_id, DeviceManager *manager,
Application *app,
int database_id, bool first_time);
~FilesystemDevice();
~FilesystemDevice() override;
bool Init();
bool Init() override;
void CloseAsync();
static QStringList url_schemes() { return QStringList() << "file"; }
private slots:
void Close();
void Close() override;
void ExitFinished();
private:

View File

@ -50,29 +50,29 @@ class GioLister : public DeviceLister {
public:
explicit GioLister() {}
~GioLister();
~GioLister() override;
int priority() const { return 50; }
int priority() const override { return 50; }
QStringList DeviceUniqueIDs();
QVariantList DeviceIcons(const QString &id);
QString DeviceManufacturer(const QString &id);
QString DeviceModel(const QString &id);
quint64 DeviceCapacity(const QString &id);
quint64 DeviceFreeSpace(const QString &id);
QVariantMap DeviceHardwareInfo(const QString &id);
bool DeviceNeedsMount(const QString &id);
QStringList DeviceUniqueIDs() override;
QVariantList DeviceIcons(const QString &id) override;
QString DeviceManufacturer(const QString &id) override;
QString DeviceModel(const QString &id) override;
quint64 DeviceCapacity(const QString &id) override;
quint64 DeviceFreeSpace(const QString &id) override;
QVariantMap DeviceHardwareInfo(const QString &id) override;
bool DeviceNeedsMount(const QString &id) override;
QString MakeFriendlyName(const QString &id);
QList<QUrl> MakeDeviceUrls(const QString &id);
QString MakeFriendlyName(const QString &id) override;
QList<QUrl> MakeDeviceUrls(const QString &id) override;
public slots:
void MountDevice(const QString &id, const int request_id);
void UnmountDevice(const QString &id);
void UpdateDeviceFreeSpace(const QString &id);
void MountDevice(const QString &id, const int request_id) override;
void UnmountDevice(const QString &id) override;
void UpdateDeviceFreeSpace(const QString &id) override;
protected:
bool Init();
bool Init() override;
private:
struct DeviceInfo {

View File

@ -37,7 +37,7 @@
class MtpConnection : public QObject, public std::enable_shared_from_this<MtpConnection> {
public:
explicit MtpConnection(const QUrl &url);
~MtpConnection();
~MtpConnection() override;
bool is_valid() const { return device_; }
LIBMTP_mtpdevice_t *device() const { return device_; }

View File

@ -49,26 +49,26 @@ class MtpDevice : public ConnectedDevice {
public:
Q_INVOKABLE MtpDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time);
~MtpDevice();
~MtpDevice() override;
static QStringList url_schemes() { return QStringList() << "mtp"; }
bool Init();
void ConnectAsync();
void Close();
bool IsLoading() { return loader_; }
bool Init() override;
void ConnectAsync() override;
void Close() override;
bool IsLoading() override { return loader_; }
bool GetSupportedFiletypes(QList<Song::FileType>* ret);
bool GetSupportedFiletypes(QList<Song::FileType>* ret) override;
int GetFreeSpace();
int GetCapacity();
bool StartCopy(QList<Song::FileType>* supported_types);
bool CopyToStorage(const CopyJob& job);
void FinishCopy(bool success);
bool StartCopy(QList<Song::FileType>* supported_types) override;
bool CopyToStorage(const CopyJob& job) override;
void FinishCopy(bool success) override;
void StartDelete();
bool DeleteFromStorage(const DeleteJob& job);
void FinishDelete(bool success);
void StartDelete() override;
bool DeleteFromStorage(const DeleteJob& job) override;
void FinishDelete(bool success) override;
private slots:
void LoadFinished(bool success, MtpConnection *connection);

View File

@ -40,7 +40,7 @@ class MtpLoader : public QObject {
public:
explicit MtpLoader(const QUrl &url, TaskManager *task_manager, CollectionBackend *backend);
~MtpLoader();
~MtpLoader() override;
bool Init();
void Abort() { abort_ = true; }

View File

@ -50,7 +50,7 @@ class Udisks2Lister : public DeviceLister {
public:
explicit Udisks2Lister();
~Udisks2Lister();
~Udisks2Lister() override;
QStringList DeviceUniqueIDs() override;
QVariantList DeviceIcons(const QString &id) override;

View File

@ -32,13 +32,13 @@ class AddStreamDialog : public QDialog {
public:
AddStreamDialog(QWidget *parent = nullptr);
~AddStreamDialog();
~AddStreamDialog() override;
QUrl url() const { return QUrl(ui_->url->text()); }
void set_url(const QUrl &url) { ui_->url->setText(url.toString());}
protected:
void showEvent(QShowEvent*);
void showEvent(QShowEvent*) override;
private slots:
void TextChanged(const QString &text);

Some files were not shown because too many files have changed in this diff Show More