Use override

This commit is contained in:
Jonas Kvinge 2020-06-26 23:01:57 +02:00
parent f1115ba706
commit b51cc21140
17 changed files with 66 additions and 66 deletions

View File

@ -92,7 +92,7 @@ public:
* @see See the corresponding QAPPLICATION_CLASS constructor for reference
*/
explicit SingleApplication( int &argc, char *argv[], bool allowSecondary = false, Options options = Mode::User, int timeout = 1000 );
~SingleApplication();
~SingleApplication() override;
/**
* @brief Returns if the instance is the primary instance

View File

@ -75,7 +75,7 @@ class SingleApplicationPrivate : public QObject {
Q_DECLARE_PUBLIC(SingleApplication)
explicit SingleApplicationPrivate(SingleApplication *_q_ptr);
~SingleApplicationPrivate();
~SingleApplicationPrivate() override;
void genBlockServerName();
void initializeMemoryBlock();

View File

@ -92,7 +92,7 @@ public:
* @see See the corresponding QAPPLICATION_CLASS constructor for reference
*/
explicit SingleCoreApplication( int &argc, char *argv[], bool allowSecondary = false, Options options = Mode::User, int timeout = 1000 );
~SingleCoreApplication();
~SingleCoreApplication() override;
/**
* @brief Returns if the instance is the primary instance

View File

@ -75,7 +75,7 @@ class SingleCoreApplicationPrivate : public QObject {
Q_DECLARE_PUBLIC(SingleCoreApplication)
explicit SingleCoreApplicationPrivate(SingleCoreApplication *_q_ptr);
~SingleCoreApplicationPrivate();
~SingleCoreApplicationPrivate() override;
void genBlockServerName();
void initializeMemoryBlock();

View File

@ -65,7 +65,7 @@ class ObjectHelper : public QObject {
Q_OBJECT
public:
ObjectHelper(QObject *sender, const char *signal, ClosureBase *closure);
~ObjectHelper();
~ObjectHelper() override;
private slots:
void Invoked();
@ -113,7 +113,7 @@ class Closure : public ClosureBase {
QObject::connect(receiver_, SIGNAL(destroyed()), helper_, SLOT(deleteLater()));
}
virtual void Invoke() {
void Invoke() override {
function_();
}
@ -167,7 +167,7 @@ class CallbackClosure : public ClosureBase {
public:
CallbackClosure(QObject *sender, const char *signal, std::function<void()> callback);
virtual void Invoke();
void Invoke() override;
private:
std::function<void()> callback_;

View File

@ -59,7 +59,7 @@ class ThreadFunctorBase : public QFutureInterface<ReturnType>, public QRunnable
return future;
}
virtual void run() = 0;
void run() override = 0;
};
template <typename ReturnType, typename... Args>
@ -69,7 +69,7 @@ class ThreadFunctor : public ThreadFunctorBase<ReturnType> {
: function_(std::bind(function, args...)) {
}
virtual void run() {
void run() override {
this->reportResult(function_());
this->reportFinished();
}
@ -86,7 +86,7 @@ class ThreadFunctor <void, Args...> : public ThreadFunctorBase<void> {
: function_(std::bind(function, args...)) {
}
virtual void run() {
void run() override {
function_();
this->reportFinished();
}

View File

@ -41,8 +41,8 @@ namespace logging {
class NullDevice : public QIODevice {
protected:
qint64 readData(char*, qint64) { return -1; }
qint64 writeData(const char*, qint64 len) { return len; }
qint64 readData(char*, qint64) override { return -1; }
qint64 writeData(const char*, qint64 len) override { return len; }
};
enum Level {

View File

@ -82,7 +82,7 @@ template <typename MT>
class AbstractMessageHandler : public _MessageHandlerBase {
public:
AbstractMessageHandler(QIODevice *device, QObject *parent);
~AbstractMessageHandler() { AbortAll(); }
~AbstractMessageHandler() override { AbortAll(); }
typedef MT MessageType;
typedef MessageReply<MT> ReplyType;
@ -107,8 +107,8 @@ protected:
virtual void MessageArrived(const MessageType &message) { Q_UNUSED(message); }
// _MessageHandlerBase
bool RawMessageArrived(const QByteArray &data);
void AbortAll();
bool RawMessageArrived(const QByteArray &data) override;
void AbortAll() override;
private:
QMap<int, ReplyType*> pending_replies_;

View File

@ -59,7 +59,7 @@ class MessageReply : public _MessageReplyBase {
public:
explicit MessageReply(const MessageType& request_message, QObject *parent = nullptr);
int id() const { return request_message_.id(); }
int id() const override { return request_message_.id(); }
const MessageType& request_message() const { return request_message_; }
const MessageType& message() const { return reply_message_; }

View File

@ -68,7 +68,7 @@ template <typename HandlerType>
class WorkerPool : public _WorkerPoolBase {
public:
explicit WorkerPool(QObject *parent = nullptr);
~WorkerPool();
~WorkerPool() override;
typedef typename HandlerType::MessageType MessageType;
typedef typename HandlerType::ReplyType ReplyType;
@ -95,10 +95,10 @@ class WorkerPool : public _WorkerPoolBase {
protected:
// These are all reimplemented slots, they are called on the WorkerPool's thread.
void DoStart();
void NewConnection();
void ProcessError(QProcess::ProcessError error);
void SendQueuedMessages();
void DoStart() override;
void NewConnection() override;
void ProcessError(QProcess::ProcessError error) override;
void SendQueuedMessages() override;
private:
struct Worker {

View File

@ -33,8 +33,8 @@ public:
explicit TagReaderWorker(QIODevice *socket, QObject *parent = nullptr);
protected:
void MessageArrived(const pb::tagreader::Message &message);
void DeviceClosed();
void MessageArrived(const pb::tagreader::Message &message) override;
void DeviceClosed() override;
private:
TagReader tag_reader_;

View File

@ -44,20 +44,20 @@ class AfcDevice : public GPodDevice {
public:
Q_INVOKABLE AfcDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, const int database_id, const bool first_time);
~AfcDevice();
~AfcDevice() override;
bool Init();
bool Init() override;
static QStringList url_schemes() { return QStringList() << "afc"; }
bool StartCopy(QList<Song::FileType> *supported_types);
bool CopyToStorage(const CopyJob &job);
void FinishCopy(const bool success);
bool StartCopy(QList<Song::FileType> *supported_types) override;
bool CopyToStorage(const CopyJob &job) override;
void FinishCopy(const bool success) override;
bool DeleteFromStorage(const DeleteJob &job);
bool DeleteFromStorage(const DeleteJob &job) override;
protected:
void FinaliseDatabase();
void FinaliseDatabase() override;
private slots:
void CopyFinished(bool success);

View File

@ -18,18 +18,18 @@ class AfcFile : public QIODevice {
public:
explicit AfcFile(iMobileDeviceConnection* connection, const QString &path, QObject *parent = nullptr);
~AfcFile();
~AfcFile() override;
// QIODevice
void close();
bool open(OpenMode mode);
bool seek(qint64 pos);
qint64 size() const;
void close() override;
bool open(OpenMode mode) override;
bool seek(qint64 pos) override;
qint64 size() const override;
private:
// QIODevice
qint64 readData(char *data, qint64 max_size);
qint64 writeData(const char *data, qint64 max_size);
qint64 readData(char *data, qint64 max_size) override;
qint64 writeData(const char *data, qint64 max_size) override;
iMobileDeviceConnection *connection_;
uint64_t handle_;

View File

@ -48,25 +48,25 @@ class GPodDevice : public ConnectedDevice, public virtual MusicStorage {
public:
Q_INVOKABLE GPodDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, const int database_id, const bool first_time);
~GPodDevice();
~GPodDevice() override;
bool Init();
void ConnectAsync();
void Close();
bool IsLoading() { return loader_; }
bool Init() override;
void ConnectAsync() override;
void Close() override;
bool IsLoading() override { return loader_; }
QObject *Loader() { return loader_; }
static QStringList url_schemes() { return QStringList() << "ipod"; }
bool GetSupportedFiletypes(QList<Song::FileType> *ret);
bool GetSupportedFiletypes(QList<Song::FileType> *ret) override;
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;
protected slots:
void LoadFinished(Itdb_iTunesDB *db, bool success);

View File

@ -41,7 +41,7 @@ class GPodLoader : public QObject {
public:
explicit GPodLoader(const QString &mount_point, TaskManager *task_manager, CollectionBackend *backend, std::shared_ptr<ConnectedDevice> device);
~GPodLoader();
~GPodLoader() override;
void set_music_path_prefix(const QString &prefix) { path_prefix_ = prefix; }
void set_song_type(Song::FileType type) { type_ = type; }

View File

@ -40,22 +40,22 @@ class iLister : public DeviceLister {
public:
explicit iLister();
~iLister();
~iLister() override;
int priority() const { return 120; }
int priority() const override { return 120; }
virtual QStringList DeviceUniqueIDs();
virtual QVariantList DeviceIcons(const QString &id);
virtual QString DeviceManufacturer(const QString &id);
virtual QString DeviceModel(const QString &id);
virtual quint64 DeviceCapacity(const QString &id);
virtual quint64 DeviceFreeSpace(const QString &id);
virtual QVariantMap DeviceHardwareInfo(const QString &id);
virtual QString MakeFriendlyName(const QString &id);
virtual QList<QUrl> MakeDeviceUrls(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;
QString MakeFriendlyName(const QString &id) override;
QList<QUrl> MakeDeviceUrls(const QString &id) override;
public slots:
virtual void UpdateDeviceFreeSpace(const QString &id);
void UpdateDeviceFreeSpace(const QString &id) override;
private:
struct DeviceInfo {
@ -80,7 +80,7 @@ class iLister : public DeviceLister {
QString bt_mac;
};
virtual bool Init();
bool Init() override;
static void EventCallback(const idevice_event_t *event, void *context);

View File

@ -34,10 +34,10 @@
class PulseDeviceFinder : public DeviceFinder {
public:
explicit PulseDeviceFinder();
~PulseDeviceFinder();
~PulseDeviceFinder() override;
virtual bool Initialise();
virtual QList<Device> ListDevices();
bool Initialise() override;
QList<Device> ListDevices() override;
private:
struct ListDevicesState {