Use override
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -49,8 +49,6 @@ DeviceDatabaseBackend::DeviceDatabaseBackend(QObject *parent) :
|
||||
|
||||
}
|
||||
|
||||
DeviceDatabaseBackend::~DeviceDatabaseBackend() {}
|
||||
|
||||
void DeviceDatabaseBackend::Init(Database* db) { db_ = db; }
|
||||
|
||||
void DeviceDatabaseBackend::Close() {
|
||||
|
||||
@@ -39,7 +39,6 @@ class DeviceDatabaseBackend : public QObject {
|
||||
|
||||
public:
|
||||
Q_INVOKABLE DeviceDatabaseBackend(QObject *parent = nullptr);
|
||||
~DeviceDatabaseBackend();
|
||||
|
||||
struct Device {
|
||||
Device() : id_(-1) {}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -189,7 +189,7 @@ DeviceView::DeviceView(QWidget *parent)
|
||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
}
|
||||
|
||||
DeviceView::~DeviceView() {}
|
||||
DeviceView::~DeviceView() = default;
|
||||
|
||||
void DeviceView::SetApplication(Application *app) {
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -35,7 +35,7 @@ class DeviceViewContainer : public QWidget {
|
||||
|
||||
public:
|
||||
explicit DeviceViewContainer(QWidget *parent = nullptr);
|
||||
~DeviceViewContainer();
|
||||
~DeviceViewContainer() override;
|
||||
|
||||
DeviceView *view() const;
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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_; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -50,7 +50,7 @@ class Udisks2Lister : public DeviceLister {
|
||||
|
||||
public:
|
||||
explicit Udisks2Lister();
|
||||
~Udisks2Lister();
|
||||
~Udisks2Lister() override;
|
||||
|
||||
QStringList DeviceUniqueIDs() override;
|
||||
QVariantList DeviceIcons(const QString &id) override;
|
||||
|
||||
Reference in New Issue
Block a user