From 596e4484f46dd347f963ca0fa1af24baa51c6fe0 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 20 Jun 2016 09:05:02 +0200 Subject: [PATCH] Clean up use of virtual and override keywords Only use virtual when actually virtual, to override just use override. --- core/backends/devicelink.h | 2 +- core/backends/lan/downloadjob.h | 4 ++-- core/backends/lan/landevicelink.h | 10 +++++----- core/backends/lan/lanlinkprovider.h | 8 ++++---- core/backends/lan/lanpairinghandler.h | 12 ++++++------ core/backends/lan/server.h | 8 ++++---- core/backends/lan/uploadjob.h | 2 +- core/backends/linkprovider.h | 2 +- core/backends/loopback/loopbackdevicelink.h | 8 ++++---- core/backends/loopback/loopbacklinkprovider.h | 8 ++++---- core/backends/pairinghandler.h | 2 +- core/daemon.h | 2 +- core/device.h | 3 ++- core/filetransferjob.h | 4 ++-- core/kdeconnectplugin.h | 2 +- core/kdeconnectpluginconfig.h | 2 +- daemon/kdeconnectd.cpp | 6 +++--- fileitemactionplugin/sendfileitemaction.h | 2 +- interfaces/dbusinterfaces.h | 18 +++++++++--------- interfaces/devicesmodel.h | 8 ++++---- interfaces/devicessortproxymodel.h | 6 +++--- interfaces/notificationsmodel.h | 8 ++++---- kcm/kcm.h | 8 ++++---- kcmplugin/kdeconnectpluginkcm.h | 2 +- .../kdeconnectdeclarativeplugin.h | 4 ++-- plasmoid/declarativeplugin/objectfactory.h | 2 +- plasmoid/declarativeplugin/processrunner.h | 2 +- plasmoid/declarativeplugin/responsewaiter.h | 2 +- plugins/battery/batterydbusinterface.h | 2 +- plugins/battery/batteryplugin.h | 6 +++--- plugins/clipboard/clipboardplugin.h | 4 ++-- plugins/findmyphone/findmyphoneplugin.h | 6 +++--- plugins/lockdevice/lockdeviceplugin.h | 2 +- plugins/mousepad/mousepadplugin.h | 6 +++--- plugins/mpriscontrol/mpriscontrolplugin.h | 4 ++-- plugins/mprisremote/mprisremoteplugin.h | 6 +++--- plugins/notifications/notification.h | 2 +- .../notifications/notificationsdbusinterface.h | 2 +- plugins/notifications/notificationsplugin.h | 6 +++--- plugins/pausemusic/pausemusic_config.h | 8 ++++---- plugins/pausemusic/pausemusicplugin.h | 4 ++-- plugins/ping/pingplugin.h | 6 +++--- plugins/runcommand/runcommand_config.h | 8 ++++---- plugins/runcommand/runcommandplugin.h | 6 +++--- .../screensaverinhibitplugin.h | 6 +++--- .../sendnotifications/notificationslistener.h | 2 +- .../notifyingapplicationmodel.h | 16 ++++++++-------- .../sendnotifications_config.h | 8 ++++---- .../sendnotificationsplugin.h | 6 +++--- plugins/sftp/mounter.h | 2 +- plugins/sftp/sftpplugin.h | 6 +++--- plugins/share/autoclosingqfile.h | 2 +- plugins/share/share_config.h | 8 ++++---- plugins/share/shareplugin.h | 4 ++-- plugins/telepathy/telepathy-cm/connection.h | 2 +- plugins/telepathy/telepathy-cm/protocol.h | 2 +- plugins/telepathy/telepathy-cm/textchannel.h | 2 +- plugins/telepathy/telepathyplugin.h | 2 +- plugins/telephony/sendsmsdialog.h | 2 +- plugins/telephony/telephonyplugin.h | 5 +++-- tests/testdaemon.h | 4 ++-- tests/testnotificationlistener.cpp | 8 ++++---- 62 files changed, 157 insertions(+), 155 deletions(-) diff --git a/core/backends/devicelink.h b/core/backends/devicelink.h index fd3fc5dd1..5eb4d204f 100644 --- a/core/backends/devicelink.h +++ b/core/backends/devicelink.h @@ -40,7 +40,7 @@ public: enum PairStatus : bool { NotPaired, Paired }; DeviceLink(const QString& deviceId, LinkProvider* parent); - virtual ~DeviceLink() { }; + virtual ~DeviceLink() = default; virtual QString name() = 0; diff --git a/core/backends/lan/downloadjob.h b/core/backends/lan/downloadjob.h index 76b857759..d73b496be 100644 --- a/core/backends/lan/downloadjob.h +++ b/core/backends/lan/downloadjob.h @@ -38,8 +38,8 @@ class KDECONNECTCORE_EXPORT DownloadJob Q_OBJECT public: DownloadJob(const QHostAddress &address, const QVariantMap &transferInfo); - ~DownloadJob(); - void start() Q_DECL_OVERRIDE; + ~DownloadJob() override; + void start() override; QSharedPointer getPayload(); private: diff --git a/core/backends/lan/landevicelink.h b/core/backends/lan/landevicelink.h index 8cc2a935f..8aa1c79b1 100644 --- a/core/backends/lan/landevicelink.h +++ b/core/backends/lan/landevicelink.h @@ -43,16 +43,16 @@ public: LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSslSocket* socket, ConnectionStarted connectionSource); void reset(QSslSocket* socket, ConnectionStarted connectionSource); - virtual QString name() Q_DECL_OVERRIDE; + QString name() override; bool sendPackage(NetworkPackage& np) override; UploadJob* sendPayload(NetworkPackage& np); - virtual void userRequestsPair() override; - virtual void userRequestsUnpair() override; + void userRequestsPair() override; + void userRequestsUnpair() override; - virtual void setPairStatus(PairStatus status) override; + void setPairStatus(PairStatus status) override; - virtual bool linkShouldBeKeptAlive() override; + bool linkShouldBeKeptAlive() override; private Q_SLOTS: void dataReceived(); diff --git a/core/backends/lan/lanlinkprovider.h b/core/backends/lan/lanlinkprovider.h index 390f89336..a6a30f7cf 100644 --- a/core/backends/lan/lanlinkprovider.h +++ b/core/backends/lan/lanlinkprovider.h @@ -41,7 +41,7 @@ class KDECONNECTCORE_EXPORT LanLinkProvider public: LanLinkProvider(bool testMode = false); - ~LanLinkProvider(); + ~LanLinkProvider() override; QString name() override { return "LanLinkProvider"; } int priority() override { return PRIORITY_HIGH; } @@ -51,9 +51,9 @@ public: void incomingPairPackage(DeviceLink* device, const NetworkPackage& np); public Q_SLOTS: - virtual void onNetworkChange() override; - virtual void onStart() override; - virtual void onStop() override; + void onNetworkChange() override; + void onStart() override; + void onStop() override; void connected(); void encrypted(); void connectError(); diff --git a/core/backends/lan/lanpairinghandler.h b/core/backends/lan/lanpairinghandler.h index fd9d692ec..eb0a8ac60 100644 --- a/core/backends/lan/lanpairinghandler.h +++ b/core/backends/lan/lanpairinghandler.h @@ -39,13 +39,13 @@ public: }; LanPairingHandler(DeviceLink* deviceLink); - virtual ~LanPairingHandler() { } + ~LanPairingHandler() override { } - virtual void packageReceived(const NetworkPackage& np) Q_DECL_OVERRIDE; - virtual bool requestPairing() Q_DECL_OVERRIDE; - virtual bool acceptPairing() Q_DECL_OVERRIDE; - virtual void rejectPairing() Q_DECL_OVERRIDE; - virtual void unpair() Q_DECL_OVERRIDE; + void packageReceived(const NetworkPackage& np) override; + bool requestPairing() override; + bool acceptPairing() override; + void rejectPairing() override; + void unpair() override; bool isPairRequested() const { return m_status == Requested; } bool isPaired() const { return m_status == Paired; } diff --git a/core/backends/lan/server.h b/core/backends/lan/server.h index fba076c9b..aa2371aa2 100644 --- a/core/backends/lan/server.h +++ b/core/backends/lan/server.h @@ -38,13 +38,13 @@ private: public: Server(QObject* parent = 0); - virtual ~Server() {} + ~Server() override = default; - QSslSocket* nextPendingConnection() Q_DECL_OVERRIDE; - bool hasPendingConnections() const Q_DECL_OVERRIDE; + QSslSocket* nextPendingConnection() override; + bool hasPendingConnections() const override; protected: - void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE; + void incomingConnection(qintptr socketDescriptor) override; }; #endif //KDECONNECT_SERVER_H diff --git a/core/backends/lan/uploadjob.h b/core/backends/lan/uploadjob.h index 2cb190b5f..0a2218232 100644 --- a/core/backends/lan/uploadjob.h +++ b/core/backends/lan/uploadjob.h @@ -36,7 +36,7 @@ class UploadJob public: explicit UploadJob(const QSharedPointer& source, const QString& deviceId); - virtual void start() override; + void start() override; QVariantMap transferInfo(); diff --git a/core/backends/linkprovider.h b/core/backends/linkprovider.h index dee358910..5dda36e4d 100644 --- a/core/backends/linkprovider.h +++ b/core/backends/linkprovider.h @@ -42,7 +42,7 @@ public: const static int PRIORITY_HIGH = 100; //eg: lan LinkProvider(); - virtual ~LinkProvider() { } + ~LinkProvider() override = default; virtual QString name() = 0; virtual int priority() = 0; diff --git a/core/backends/loopback/loopbackdevicelink.h b/core/backends/loopback/loopbackdevicelink.h index 259355901..7cbb56a6d 100644 --- a/core/backends/loopback/loopbackdevicelink.h +++ b/core/backends/loopback/loopbackdevicelink.h @@ -32,11 +32,11 @@ class LoopbackDeviceLink public: LoopbackDeviceLink(const QString& d, LoopbackLinkProvider* a); - virtual QString name() override; - virtual bool sendPackage(NetworkPackage& np) override; + QString name() override; + bool sendPackage(NetworkPackage& np) override; - virtual void userRequestsPair() override { setPairStatus(Paired); } - virtual void userRequestsUnpair() override { setPairStatus(NotPaired); } + void userRequestsPair() override { setPairStatus(Paired); } + void userRequestsUnpair() override { setPairStatus(NotPaired); } }; #endif diff --git a/core/backends/loopback/loopbacklinkprovider.h b/core/backends/loopback/loopbacklinkprovider.h index 6a2fc823b..987ba3e44 100644 --- a/core/backends/loopback/loopbacklinkprovider.h +++ b/core/backends/loopback/loopbacklinkprovider.h @@ -31,14 +31,14 @@ class LoopbackLinkProvider Q_OBJECT public: LoopbackLinkProvider(); - ~LoopbackLinkProvider(); + ~LoopbackLinkProvider() override; QString name() override { return "LoopbackLinkProvider"; } int priority() override { return PRIORITY_LOW; } - virtual void onStart() override; - virtual void onStop() override; - virtual void onNetworkChange() override; + void onStart() override; + void onStop() override; + void onNetworkChange() override; private: QPointer loopbackDeviceLink; diff --git a/core/backends/pairinghandler.h b/core/backends/pairinghandler.h index 95c91f6a1..e918b3cc0 100644 --- a/core/backends/pairinghandler.h +++ b/core/backends/pairinghandler.h @@ -43,7 +43,7 @@ class KDECONNECTCORE_EXPORT PairingHandler : public QObject public: PairingHandler(DeviceLink* parent); - virtual ~PairingHandler() { } + ~PairingHandler() override = default; DeviceLink* deviceLink() const; void setDeviceLink(DeviceLink* dl); diff --git a/core/daemon.h b/core/daemon.h index 1addbe478..a72cbe9ae 100644 --- a/core/daemon.h +++ b/core/daemon.h @@ -42,7 +42,7 @@ class KDECONNECTCORE_EXPORT Daemon public: explicit Daemon(QObject *parent, bool testMode = false); - ~Daemon(); + ~Daemon() override; /** * Returns the daemon. diff --git a/core/device.h b/core/device.h index 08f1f47d2..16dd9cf77 100644 --- a/core/device.h +++ b/core/device.h @@ -78,7 +78,7 @@ public: */ Device(QObject* parent, const NetworkPackage& np, DeviceLink* dl); - virtual ~Device(); + ~Device() override; QString id() const { return m_deviceId; } QString name() const { return m_deviceName; } @@ -113,6 +113,7 @@ public: public Q_SLOTS: ///sends a @p np package to the device + ///virtual for testing purposes. virtual bool sendPackage(NetworkPackage& np); //Dbus operations diff --git a/core/filetransferjob.h b/core/filetransferjob.h index 9d90b8bf2..a4ea1ee7d 100644 --- a/core/filetransferjob.h +++ b/core/filetransferjob.h @@ -53,7 +53,7 @@ public: * @p destination specifies where these contents should be stored */ FileTransferJob(const QSharedPointer& origin, qint64 size, const QUrl &destination); - virtual void start() Q_DECL_OVERRIDE; + void start() override; QUrl destination() const { return mDestination; } void setOriginName(QString from) { mFrom = from; } @@ -61,7 +61,7 @@ private Q_SLOTS: void doStart(); protected: - bool doKill() Q_DECL_OVERRIDE; + bool doKill() override; private: void startTransfer(); diff --git a/core/kdeconnectplugin.h b/core/kdeconnectplugin.h index 297bf0c84..08fadffe1 100644 --- a/core/kdeconnectplugin.h +++ b/core/kdeconnectplugin.h @@ -38,7 +38,7 @@ class KDECONNECTCORE_EXPORT KdeConnectPlugin public: KdeConnectPlugin(QObject* parent, const QVariantList& args); - virtual ~KdeConnectPlugin(); + ~KdeConnectPlugin() override; const Device* device(); Device const* device() const; diff --git a/core/kdeconnectpluginconfig.h b/core/kdeconnectpluginconfig.h index a3fcf18ee..0f2dcbde9 100644 --- a/core/kdeconnectpluginconfig.h +++ b/core/kdeconnectpluginconfig.h @@ -37,7 +37,7 @@ class KDECONNECTCORE_EXPORT KdeConnectPluginConfig : public QObject public: KdeConnectPluginConfig(const QString& deviceId, const QString& pluginName); - ~KdeConnectPluginConfig(); + ~KdeConnectPluginConfig() override; /** * A directory to store stuff for this device and plugin. It's private in the sense diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index bec04d6ea..4243a0224 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -41,7 +41,7 @@ public: , m_nam(Q_NULLPTR) {} - void askPairingConfirmation(PairingHandler* d) Q_DECL_OVERRIDE + void askPairingConfirmation(PairingHandler* d) override { KNotification* notification = new KNotification("pairingRequest"); notification->setIconName(QStringLiteral("dialog-information")); @@ -54,12 +54,12 @@ public: notification->sendEvent(); } - void reportError(const QString & title, const QString & description) Q_DECL_OVERRIDE + void reportError(const QString & title, const QString & description) override { KNotification::event(KNotification::Error, title, description); } - QNetworkAccessManager* networkAccessManager() Q_DECL_OVERRIDE + QNetworkAccessManager* networkAccessManager() override { if (!m_nam) { m_nam = new KIO::AccessManager(this); diff --git a/fileitemactionplugin/sendfileitemaction.h b/fileitemactionplugin/sendfileitemaction.h index da73597a7..3e4d99f43 100644 --- a/fileitemactionplugin/sendfileitemaction.h +++ b/fileitemactionplugin/sendfileitemaction.h @@ -35,7 +35,7 @@ class SendFileItemAction : public KAbstractFileItemActionPlugin Q_OBJECT public: SendFileItemAction(QObject* parent, const QVariantList &args); - virtual QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) override; + QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) override; private Q_SLOTS: void sendFile(); diff --git a/interfaces/dbusinterfaces.h b/interfaces/dbusinterfaces.h index e1baefd89..20fa086d7 100644 --- a/interfaces/dbusinterfaces.h +++ b/interfaces/dbusinterfaces.h @@ -45,7 +45,7 @@ class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface Q_OBJECT public: explicit DaemonDbusInterface(QObject* parent = nullptr); - virtual ~DaemonDbusInterface(); + ~DaemonDbusInterface() override; static QString activatedService(); @@ -63,7 +63,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface public: explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); - virtual ~DeviceDbusInterface(); + ~DeviceDbusInterface() override; Q_SCRIPTABLE QString id() const; Q_SCRIPTABLE void pluginCall(const QString &plugin, const QString &method); @@ -81,7 +81,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceBatteryDbusInterface Q_OBJECT public: explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = nullptr); - virtual ~DeviceBatteryDbusInterface(); + ~DeviceBatteryDbusInterface() override; }; class KDECONNECTINTERFACES_EXPORT DeviceNotificationsDbusInterface @@ -90,7 +90,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceNotificationsDbusInterface Q_OBJECT public: explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = nullptr); - virtual ~DeviceNotificationsDbusInterface(); + ~DeviceNotificationsDbusInterface() override; }; class KDECONNECTINTERFACES_EXPORT NotificationDbusInterface @@ -99,7 +99,7 @@ class KDECONNECTINTERFACES_EXPORT NotificationDbusInterface Q_OBJECT public: NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = nullptr); - virtual ~NotificationDbusInterface(); + ~NotificationDbusInterface() override; QString notificationId() { return id; } private: @@ -113,7 +113,7 @@ class KDECONNECTINTERFACES_EXPORT SftpDbusInterface Q_OBJECT public: explicit SftpDbusInterface(const QString& deviceId, QObject* parent = nullptr); - virtual ~SftpDbusInterface(); + ~SftpDbusInterface() override; }; class KDECONNECTINTERFACES_EXPORT MprisDbusInterface @@ -130,7 +130,7 @@ class KDECONNECTINTERFACES_EXPORT MprisDbusInterface Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy) public: explicit MprisDbusInterface(const QString& deviceId, QObject* parent = nullptr); - virtual ~MprisDbusInterface(); + ~MprisDbusInterface() override; Q_SIGNALS: void propertiesChangedProxy(); @@ -152,7 +152,7 @@ class KDECONNECTINTERFACES_EXPORT LockDeviceDbusInterface Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy) public: explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); - virtual ~LockDeviceDbusInterface(); + ~LockDeviceDbusInterface() override; Q_SIGNALS: void lockedChangedProxy(bool isLocked); @@ -164,7 +164,7 @@ class KDECONNECTINTERFACES_EXPORT FindMyPhoneDeviceDbusInterface Q_OBJECT public: explicit FindMyPhoneDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); - virtual ~FindMyPhoneDeviceDbusInterface(); + ~FindMyPhoneDeviceDbusInterface() override; }; class KDECONNECTINTERFACES_EXPORT RemoteCommandsDbusInterface diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h index a4f6ae894..28014b670 100644 --- a/interfaces/devicesmodel.h +++ b/interfaces/devicesmodel.h @@ -61,16 +61,16 @@ public: Q_ENUM(StatusFilterFlag) explicit DevicesModel(QObject *parent = nullptr); - virtual ~DevicesModel(); + ~DevicesModel() override; void setDisplayFilter(int flags); int displayFilter() const; - virtual QVariant data(const QModelIndex& index, int role) const override; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; Q_SCRIPTABLE DeviceDbusInterface* getDevice(int row) const; - virtual QHash roleNames() const override; + QHash roleNames() const override; private Q_SLOTS: void deviceAdded(const QString& id); diff --git a/interfaces/devicessortproxymodel.h b/interfaces/devicessortproxymodel.h index 568282035..501a9d3e3 100644 --- a/interfaces/devicessortproxymodel.h +++ b/interfaces/devicessortproxymodel.h @@ -31,9 +31,9 @@ class KDECONNECTINTERFACES_EXPORT DevicesSortProxyModel : public QSortFilterProx Q_OBJECT public: explicit DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR); - virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const override; - virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; - virtual void setSourceModel(QAbstractItemModel *sourceModel) override; + bool lessThan(const QModelIndex& left, const QModelIndex& right) const override; + bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; + void setSourceModel(QAbstractItemModel *sourceModel) override; public Q_SLOTS: void sourceDataChanged(); diff --git a/interfaces/notificationsmodel.h b/interfaces/notificationsmodel.h index 83a93753c..b3b9005a3 100644 --- a/interfaces/notificationsmodel.h +++ b/interfaces/notificationsmodel.h @@ -48,18 +48,18 @@ public: }; explicit NotificationsModel(QObject* parent = nullptr); - virtual ~NotificationsModel(); + ~NotificationsModel() override; QString deviceId() const; void setDeviceId(const QString& deviceId); - virtual QVariant data(const QModelIndex& index, int role) const override; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; NotificationDbusInterface* getNotification(const QModelIndex& index) const; Q_INVOKABLE bool isAnyDimissable() const; - virtual QHash roleNames() const override; + QHash roleNames() const override; public Q_SLOTS: void dismissAll(); diff --git a/kcm/kcm.h b/kcm/kcm.h index cdc2a3ed6..32fce5ef5 100644 --- a/kcm/kcm.h +++ b/kcm/kcm.h @@ -40,12 +40,12 @@ class KdeConnectKcm Q_OBJECT public: KdeConnectKcm(QWidget *parent, const QVariantList&); - virtual ~KdeConnectKcm(); + ~KdeConnectKcm() override; private: - virtual void save(); - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + void save() override; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; private Q_SLOTS: void deviceSelected(const QModelIndex& current); diff --git a/kcmplugin/kdeconnectpluginkcm.h b/kcmplugin/kdeconnectpluginkcm.h index bf669162c..2611719bb 100644 --- a/kcmplugin/kdeconnectpluginkcm.h +++ b/kcmplugin/kdeconnectpluginkcm.h @@ -39,7 +39,7 @@ class KDECONNECTPLUGINKCM_EXPORT KdeConnectPluginKcm public: KdeConnectPluginKcm(QWidget* parent, const QVariantList& args, const QString& componentName); - virtual ~KdeConnectPluginKcm(); + ~KdeConnectPluginKcm() override; /** * The device this kcm is instantiated for diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h index 1944dc6ec..bdbef5342 100644 --- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h +++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h @@ -29,8 +29,8 @@ class KdeConnectDeclarativePlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - virtual void registerTypes(const char* uri) override; - virtual void initializeEngine(QQmlEngine *engine, const char *uri) override; + void registerTypes(const char* uri) override; + void initializeEngine(QQmlEngine *engine, const char *uri) override; }; #endif // KDECONNECTDECLARATIVEPLUGIN_H diff --git a/plasmoid/declarativeplugin/objectfactory.h b/plasmoid/declarativeplugin/objectfactory.h index c7ab0d6f6..dc9e95e40 100644 --- a/plasmoid/declarativeplugin/objectfactory.h +++ b/plasmoid/declarativeplugin/objectfactory.h @@ -19,7 +19,7 @@ public: ObjectFactory(QObject* parent, Func1 f1) : QObject(parent), m_f0(nullptr), m_f1(f1), m_f2(nullptr) {} ObjectFactory(QObject* parent, Func2 f2) : QObject(parent), m_f0(nullptr), m_f1(nullptr), m_f2(f2) {} - virtual ~ObjectFactory() {} + ~ObjectFactory() override = default; Q_INVOKABLE QObject* create() { if (m_f0) return m_f0(); diff --git a/plasmoid/declarativeplugin/processrunner.h b/plasmoid/declarativeplugin/processrunner.h index 27cfa6cdd..880b82c15 100644 --- a/plasmoid/declarativeplugin/processrunner.h +++ b/plasmoid/declarativeplugin/processrunner.h @@ -28,7 +28,7 @@ class ProcessRunner : public QObject public: explicit ProcessRunner(QObject *parent = nullptr); - ~ProcessRunner(); + ~ProcessRunner() override; Q_INVOKABLE void runKdeconnectKCM(); }; diff --git a/plasmoid/declarativeplugin/responsewaiter.h b/plasmoid/declarativeplugin/responsewaiter.h index 8b0ddf180..68a75f7a3 100644 --- a/plasmoid/declarativeplugin/responsewaiter.h +++ b/plasmoid/declarativeplugin/responsewaiter.h @@ -37,7 +37,7 @@ class DBusAsyncResponse : public QObject public: explicit DBusAsyncResponse(QObject* parent = nullptr); - virtual ~DBusAsyncResponse() {}; + ~DBusAsyncResponse() override = default; Q_INVOKABLE void setPendingCall(QVariant e); diff --git a/plugins/battery/batterydbusinterface.h b/plugins/battery/batterydbusinterface.h index 01d4ef7d5..e21d9c589 100644 --- a/plugins/battery/batterydbusinterface.h +++ b/plugins/battery/batterydbusinterface.h @@ -33,7 +33,7 @@ class BatteryDbusInterface public: explicit BatteryDbusInterface(const Device *device); - virtual ~BatteryDbusInterface(); + ~BatteryDbusInterface() override; Q_SCRIPTABLE int charge() const { return mCharge; } Q_SCRIPTABLE bool isCharging() const { return mIsCharging; } diff --git a/plugins/battery/batteryplugin.h b/plugins/battery/batteryplugin.h index de95f4e53..a6788d1a4 100644 --- a/plugins/battery/batteryplugin.h +++ b/plugins/battery/batteryplugin.h @@ -36,11 +36,11 @@ class BatteryPlugin public: explicit BatteryPlugin(QObject *parent, const QVariantList &args); - virtual ~BatteryPlugin(); + ~BatteryPlugin() override; public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override; + bool receivePackage(const NetworkPackage& np) override; + void connected() override; private: // Keep these values in sync with THRESHOLD* constants in diff --git a/plugins/clipboard/clipboardplugin.h b/plugins/clipboard/clipboardplugin.h index 7edcebe29..6d1bc7a5d 100644 --- a/plugins/clipboard/clipboardplugin.h +++ b/plugins/clipboard/clipboardplugin.h @@ -38,8 +38,8 @@ public: explicit ClipboardPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override { } + bool receivePackage(const NetworkPackage& np) override; + void connected() override { } private Q_SLOTS: void clipboardChanged(QClipboard::Mode mode); diff --git a/plugins/findmyphone/findmyphoneplugin.h b/plugins/findmyphone/findmyphoneplugin.h index f0cbf4814..459015c15 100644 --- a/plugins/findmyphone/findmyphoneplugin.h +++ b/plugins/findmyphone/findmyphoneplugin.h @@ -35,13 +35,13 @@ class FindMyPhonePlugin public: explicit FindMyPhonePlugin(QObject *parent, const QVariantList &args); - virtual ~FindMyPhonePlugin(); + ~FindMyPhonePlugin() override; Q_SCRIPTABLE void ring(); public Q_SLOTS: - virtual void connected(); - virtual bool receivePackage(const NetworkPackage& np); + void connected() override; + bool receivePackage(const NetworkPackage& np) override; private: QString dbusPath() const; diff --git a/plugins/lockdevice/lockdeviceplugin.h b/plugins/lockdevice/lockdeviceplugin.h index b1672ce00..485607b1e 100644 --- a/plugins/lockdevice/lockdeviceplugin.h +++ b/plugins/lockdevice/lockdeviceplugin.h @@ -39,7 +39,7 @@ class Q_DECL_EXPORT LockDevicePlugin public: explicit LockDevicePlugin(QObject *parent, const QVariantList &args); - virtual ~LockDevicePlugin(); + ~LockDevicePlugin() override; bool isLocked() const; void setLocked(bool b); diff --git a/plugins/mousepad/mousepadplugin.h b/plugins/mousepad/mousepadplugin.h index 6044c387b..e9017322d 100644 --- a/plugins/mousepad/mousepadplugin.h +++ b/plugins/mousepad/mousepadplugin.h @@ -44,10 +44,10 @@ class MousepadPlugin public: explicit MousepadPlugin(QObject *parent, const QVariantList &args); - virtual ~MousepadPlugin(); + ~MousepadPlugin() override; - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override { } + bool receivePackage(const NetworkPackage& np) override; + void connected() override { } private: #if HAVE_X11 diff --git a/plugins/mpriscontrol/mpriscontrolplugin.h b/plugins/mpriscontrol/mpriscontrolplugin.h index f61438a04..66145cde3 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin.h +++ b/plugins/mpriscontrol/mpriscontrolplugin.h @@ -41,8 +41,8 @@ public: explicit MprisControlPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override { } + bool receivePackage(const NetworkPackage& np) override; + void connected() override { } private Q_SLOTS: void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties); diff --git a/plugins/mprisremote/mprisremoteplugin.h b/plugins/mprisremote/mprisremoteplugin.h index a96d356a1..89b2e4cdd 100644 --- a/plugins/mprisremote/mprisremoteplugin.h +++ b/plugins/mprisremote/mprisremoteplugin.h @@ -43,7 +43,7 @@ class Q_DECL_EXPORT MprisRemotePlugin public: explicit MprisRemotePlugin(QObject *parent, const QVariantList &args); - virtual ~MprisRemotePlugin(); + ~MprisRemotePlugin() override; long position() const; int volume() const { return m_volume; } @@ -58,8 +58,8 @@ public: void setPlayer(const QString& player); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + bool receivePackage(const NetworkPackage& np) override; + void connected() override; void seek(int offset) const; void requestPlayerStatus(); diff --git a/plugins/notifications/notification.h b/plugins/notifications/notification.h index dcf09a77c..39a73ea43 100644 --- a/plugins/notifications/notification.h +++ b/plugins/notifications/notification.h @@ -39,7 +39,7 @@ class Notification public: Notification(const NetworkPackage& np, const QString& iconPath, QObject* parent); - virtual ~Notification(); + ~Notification() override; QString internalId() const { return mInternalId; } QString appName() const { return mAppName; } diff --git a/plugins/notifications/notificationsdbusinterface.h b/plugins/notifications/notificationsdbusinterface.h index ada6bb89c..b8120f661 100644 --- a/plugins/notifications/notificationsdbusinterface.h +++ b/plugins/notifications/notificationsdbusinterface.h @@ -40,7 +40,7 @@ class NotificationsDbusInterface public: explicit NotificationsDbusInterface(KdeConnectPlugin* plugin); - virtual ~NotificationsDbusInterface(); + ~NotificationsDbusInterface() override; void processPackage(const NetworkPackage& np); void clearNotifications(); diff --git a/plugins/notifications/notificationsplugin.h b/plugins/notifications/notificationsplugin.h index 46bd1e2e7..3a5c6e559 100644 --- a/plugins/notifications/notificationsplugin.h +++ b/plugins/notifications/notificationsplugin.h @@ -42,11 +42,11 @@ class NotificationsPlugin public: explicit NotificationsPlugin(QObject *parent, const QVariantList &args); - virtual ~NotificationsPlugin(); + ~NotificationsPlugin() override; public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override; + bool receivePackage(const NetworkPackage& np) override; + void connected() override; protected: NotificationsDbusInterface* notificationsDbusInterface; diff --git a/plugins/pausemusic/pausemusic_config.h b/plugins/pausemusic/pausemusic_config.h index 002e39e8b..62ff6f6d2 100644 --- a/plugins/pausemusic/pausemusic_config.h +++ b/plugins/pausemusic/pausemusic_config.h @@ -33,12 +33,12 @@ class PauseMusicConfig Q_OBJECT public: PauseMusicConfig(QWidget *parent, const QVariantList&); - virtual ~PauseMusicConfig(); + ~PauseMusicConfig() override; public Q_SLOTS: - virtual void save() override; - virtual void load() override; - virtual void defaults() override; + void save() override; + void load() override; + void defaults() override; private: Ui::PauseMusicConfigUi* m_ui; diff --git a/plugins/pausemusic/pausemusicplugin.h b/plugins/pausemusic/pausemusicplugin.h index 404e2341d..f4c712a3e 100644 --- a/plugins/pausemusic/pausemusicplugin.h +++ b/plugins/pausemusic/pausemusicplugin.h @@ -36,8 +36,8 @@ public: explicit PauseMusicPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override { } + bool receivePackage(const NetworkPackage& np) override; + void connected() override { } /** * @returns 0 if not muted, 1 if muted or -1 if there was an error diff --git a/plugins/ping/pingplugin.h b/plugins/ping/pingplugin.h index d122c5c2d..a0b65892a 100644 --- a/plugins/ping/pingplugin.h +++ b/plugins/ping/pingplugin.h @@ -35,14 +35,14 @@ class Q_DECL_EXPORT PingPlugin public: explicit PingPlugin(QObject *parent, const QVariantList &args); - virtual ~PingPlugin(); + ~PingPlugin() override; Q_SCRIPTABLE void sendPing(); Q_SCRIPTABLE void sendPing(const QString& customMessage); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override; + bool receivePackage(const NetworkPackage& np) override; + void connected() override; private: QString dbusPath() const; diff --git a/plugins/runcommand/runcommand_config.h b/plugins/runcommand/runcommand_config.h index 87abab0a4..a22693bf4 100644 --- a/plugins/runcommand/runcommand_config.h +++ b/plugins/runcommand/runcommand_config.h @@ -31,12 +31,12 @@ class RunCommandConfig Q_OBJECT public: RunCommandConfig(QWidget *parent, const QVariantList&); - virtual ~RunCommandConfig(); + ~RunCommandConfig() override; public Q_SLOTS: - virtual void save() Q_DECL_OVERRIDE; - virtual void load() Q_DECL_OVERRIDE; - virtual void defaults() Q_DECL_OVERRIDE; + void save() override; + void load() override; + void defaults() override; private Q_SLOTS: void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); diff --git a/plugins/runcommand/runcommandplugin.h b/plugins/runcommand/runcommandplugin.h index a5b970ecb..33cba0b02 100644 --- a/plugins/runcommand/runcommandplugin.h +++ b/plugins/runcommand/runcommandplugin.h @@ -37,12 +37,12 @@ class Q_DECL_EXPORT RunCommandPlugin public: explicit RunCommandPlugin(QObject *parent, const QVariantList &args); - virtual ~RunCommandPlugin(); + ~RunCommandPlugin() override; public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + bool receivePackage(const NetworkPackage& np) override; + void connected() override; private Q_SLOTS: void configChanged(); diff --git a/plugins/screensaver-inhibit/screensaverinhibitplugin.h b/plugins/screensaver-inhibit/screensaverinhibitplugin.h index 5589ad494..3ab32dcf6 100644 --- a/plugins/screensaver-inhibit/screensaverinhibitplugin.h +++ b/plugins/screensaver-inhibit/screensaverinhibitplugin.h @@ -32,11 +32,11 @@ class Q_DECL_EXPORT ScreensaverInhibitPlugin public: explicit ScreensaverInhibitPlugin(QObject *parent, const QVariantList &args); - virtual ~ScreensaverInhibitPlugin(); + ~ScreensaverInhibitPlugin() override; public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override; + bool receivePackage(const NetworkPackage& np) override; + void connected() override; private: uint inhibitCookie; diff --git a/plugins/sendnotifications/notificationslistener.h b/plugins/sendnotifications/notificationslistener.h index aeed3a745..0612c34b8 100644 --- a/plugins/sendnotifications/notificationslistener.h +++ b/plugins/sendnotifications/notificationslistener.h @@ -32,7 +32,7 @@ class NotificationsListener : public QDBusAbstractAdaptor public: explicit NotificationsListener(KdeConnectPlugin* aPlugin); - virtual ~NotificationsListener(); + ~NotificationsListener() override; protected: KdeConnectPlugin* mPlugin; diff --git a/plugins/sendnotifications/notifyingapplicationmodel.h b/plugins/sendnotifications/notifyingapplicationmodel.h index efeda1951..7c729ff74 100644 --- a/plugins/sendnotifications/notifyingapplicationmodel.h +++ b/plugins/sendnotifications/notifyingapplicationmodel.h @@ -31,15 +31,15 @@ class NotifyingApplicationModel: public QAbstractTableModel public: explicit NotifyingApplicationModel(QObject *parent = nullptr); - virtual ~NotifyingApplicationModel(); + ~NotifyingApplicationModel() override; - virtual QVariant data(const QModelIndex& index, int role) const override; - virtual bool setData(const QModelIndex &index, const QVariant &value, int role) override; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const override; - virtual Qt::ItemFlags flags(const QModelIndex & index) const override; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; + QVariant data(const QModelIndex& index, int role) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + Qt::ItemFlags flags(const QModelIndex & index) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; QVector apps(); void clearApplications(); diff --git a/plugins/sendnotifications/sendnotifications_config.h b/plugins/sendnotifications/sendnotifications_config.h index 3a5b17675..f4d6d5294 100644 --- a/plugins/sendnotifications/sendnotifications_config.h +++ b/plugins/sendnotifications/sendnotifications_config.h @@ -35,12 +35,12 @@ class SendNotificationsConfig Q_OBJECT public: SendNotificationsConfig(QWidget *parent, const QVariantList&); - virtual ~SendNotificationsConfig(); + ~SendNotificationsConfig() override; public Q_SLOTS: - virtual void save() override; - virtual void load() override; - virtual void defaults() override; + void save() override; + void load() override; + void defaults() override; private Q_SLOTS: void loadApplications(); diff --git a/plugins/sendnotifications/sendnotificationsplugin.h b/plugins/sendnotifications/sendnotificationsplugin.h index fcb893546..3c52c0b1a 100644 --- a/plugins/sendnotifications/sendnotificationsplugin.h +++ b/plugins/sendnotifications/sendnotificationsplugin.h @@ -41,11 +41,11 @@ class SendNotificationsPlugin public: explicit SendNotificationsPlugin(QObject *parent, const QVariantList &args); - virtual ~SendNotificationsPlugin(); + ~SendNotificationsPlugin() override; public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override; + bool receivePackage(const NetworkPackage& np) override; + void connected() override; protected: NotificationsListener* notificationsListener; diff --git a/plugins/sftp/mounter.h b/plugins/sftp/mounter.h index 00aafb3f5..a9edc2605 100644 --- a/plugins/sftp/mounter.h +++ b/plugins/sftp/mounter.h @@ -35,7 +35,7 @@ class Mounter public: explicit Mounter(SftpPlugin *sftp); - virtual ~Mounter(); + ~Mounter() override; bool wait(); bool isMounted() const { return m_started; } diff --git a/plugins/sftp/sftpplugin.h b/plugins/sftp/sftpplugin.h index 8015488dc..9b9b5b9ad 100644 --- a/plugins/sftp/sftpplugin.h +++ b/plugins/sftp/sftpplugin.h @@ -36,7 +36,7 @@ class SftpPlugin public: explicit SftpPlugin(QObject *parent, const QVariantList &args); - virtual ~SftpPlugin(); + ~SftpPlugin() override; Q_SIGNALS: void packageReceived(const NetworkPackage& np); @@ -44,8 +44,8 @@ Q_SIGNALS: Q_SCRIPTABLE void unmounted(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override; + bool receivePackage(const NetworkPackage& np) override; + void connected() override; Q_SCRIPTABLE void mount(); Q_SCRIPTABLE void unmount(); diff --git a/plugins/share/autoclosingqfile.h b/plugins/share/autoclosingqfile.h index 19f4fedba..a90798d64 100644 --- a/plugins/share/autoclosingqfile.h +++ b/plugins/share/autoclosingqfile.h @@ -29,7 +29,7 @@ class AutoClosingQFile : public QFile public: explicit AutoClosingQFile(const QString &name); - qint64 readData(char* data, qint64 maxlen) Q_DECL_OVERRIDE { + qint64 readData(char* data, qint64 maxlen) override { qint64 read = QFile::readData(data, maxlen); if (read == -1 || read == bytesAvailable()) { close(); diff --git a/plugins/share/share_config.h b/plugins/share/share_config.h index f4ecadf4a..6773a2ea4 100644 --- a/plugins/share/share_config.h +++ b/plugins/share/share_config.h @@ -33,12 +33,12 @@ class ShareConfig Q_OBJECT public: ShareConfig(QWidget *parent, const QVariantList&); - virtual ~ShareConfig(); + ~ShareConfig() override; public Q_SLOTS: - virtual void save() override; - virtual void load() override; - virtual void defaults() override; + void save() override; + void load() override; + void defaults() override; private: Ui::ShareConfigUi* m_ui; diff --git a/plugins/share/shareplugin.h b/plugins/share/shareplugin.h index 9f3082a20..626bac96d 100644 --- a/plugins/share/shareplugin.h +++ b/plugins/share/shareplugin.h @@ -40,8 +40,8 @@ public: ///Helper method, QDBus won't recognize QUrl Q_SCRIPTABLE void shareUrl(const QString& url) { shareUrl(QUrl(url)); } public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override; + bool receivePackage(const NetworkPackage& np) override; + void connected() override; private Q_SLOTS: void finished(KJob*); diff --git a/plugins/telepathy/telepathy-cm/connection.h b/plugins/telepathy/telepathy-cm/connection.h index 291665569..090374ba6 100644 --- a/plugins/telepathy/telepathy-cm/connection.h +++ b/plugins/telepathy/telepathy-cm/connection.h @@ -24,7 +24,7 @@ public: ConnectConnection(const QDBusConnection &dbusConnection, const QString &cmName, const QString &protocolName, const QVariantMap ¶meters); - ~ConnectConnection(); + ~ConnectConnection() override; static Tp::SimpleStatusSpecMap getSimpleStatusSpecMap(); diff --git a/plugins/telepathy/telepathy-cm/protocol.h b/plugins/telepathy/telepathy-cm/protocol.h index 6d4e4faf4..25eb4d3e6 100644 --- a/plugins/telepathy/telepathy-cm/protocol.h +++ b/plugins/telepathy/telepathy-cm/protocol.h @@ -26,7 +26,7 @@ class KDEConnectTelepathyProtocol : public Tp::BaseProtocol public: KDEConnectTelepathyProtocol(const QDBusConnection &dbusConnection, const QString &name); - virtual ~KDEConnectTelepathyProtocol(); + ~KDEConnectTelepathyProtocol() override; QString connectionManagerName() const; void setConnectionManagerName(const QString &newName); diff --git a/plugins/telepathy/telepathy-cm/textchannel.h b/plugins/telepathy/telepathy-cm/textchannel.h index 163a23e08..9cbea986b 100644 --- a/plugins/telepathy/telepathy-cm/textchannel.h +++ b/plugins/telepathy/telepathy-cm/textchannel.h @@ -25,7 +25,7 @@ class ConnectTextChannel : public Tp::BaseChannelTextType Q_OBJECT public: static ConnectTextChannelPtr create(QObject *connection, Tp::BaseChannel *baseChannel, uint targetHandle, const QString &identifier); - virtual ~ConnectTextChannel(); + ~ConnectTextChannel() override; QString sendMessageCallback(const Tp::MessagePartList &messageParts, uint flags, Tp::DBusError *error); diff --git a/plugins/telepathy/telepathyplugin.h b/plugins/telepathy/telepathyplugin.h index c2c61f580..106336c72 100644 --- a/plugins/telepathy/telepathyplugin.h +++ b/plugins/telepathy/telepathyplugin.h @@ -41,7 +41,7 @@ public: void connected() override {} public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; + bool receivePackage(const NetworkPackage& np) override; private Q_SLOTS: void sendSms(const QString& phoneNumber, const QString& messageBody); diff --git a/plugins/telephony/sendsmsdialog.h b/plugins/telephony/sendsmsdialog.h index 4f70b8a98..b56bbc15b 100644 --- a/plugins/telephony/sendsmsdialog.h +++ b/plugins/telephony/sendsmsdialog.h @@ -34,7 +34,7 @@ class SendSmsDialog : public QDialog public: explicit SendSmsDialog(const QString& originalMessage, const QString& phoneNumber, const QString& contactName, QWidget *parent = nullptr); - virtual QSize sizeHint() const override; + QSize sizeHint() const override; private Q_SLOTS: void sendButtonClicked(); diff --git a/plugins/telephony/telephonyplugin.h b/plugins/telephony/telephonyplugin.h index c7ec17bb7..b08d09bc0 100644 --- a/plugins/telephony/telephonyplugin.h +++ b/plugins/telephony/telephonyplugin.h @@ -40,9 +40,10 @@ class TelephonyPlugin public: explicit TelephonyPlugin(QObject *parent, const QVariantList &args); + bool receivePackage(const NetworkPackage& np) override; + void connected() override { } + public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np) override; - virtual void connected() override { } void sendMutePackage(); private Q_SLOTS: diff --git a/tests/testdaemon.h b/tests/testdaemon.h index 809dfbf49..d081a6ba5 100644 --- a/tests/testdaemon.h +++ b/tests/testdaemon.h @@ -33,7 +33,7 @@ public: { } - void reportError(const QString & title, const QString & description) Q_DECL_OVERRIDE + void reportError(const QString & title, const QString & description) override { qWarning() << "error:" << title << description; } @@ -42,7 +42,7 @@ public: d->acceptPairing(); } - QNetworkAccessManager* networkAccessManager() Q_DECL_OVERRIDE + QNetworkAccessManager* networkAccessManager() override { if (!m_nam) { m_nam = new KIO::AccessManager(this); diff --git a/tests/testnotificationlistener.cpp b/tests/testnotificationlistener.cpp index 45597fa5b..59367f97d 100644 --- a/tests/testnotificationlistener.cpp +++ b/tests/testnotificationlistener.cpp @@ -45,7 +45,7 @@ public: { } - virtual ~TestNotificationsPlugin() {}; + ~TestNotificationsPlugin() override = default; // allow to access notificationsListener for testing: NotificationsListener* getNotificationsListener() const @@ -75,7 +75,7 @@ public: , lastPackage(nullptr) {} - virtual ~TestDevice() + ~TestDevice() override { delete lastPackage; } @@ -91,7 +91,7 @@ public: } public Q_SLOTS: - virtual bool sendPackage(NetworkPackage& np) override + bool sendPackage(NetworkPackage& np) override { ++sentPackages; // copy package manually to allow for inspection (can't use copy-constructor) @@ -115,7 +115,7 @@ public: : NotificationsListener(aPlugin) {} - virtual ~TestedNotificationsListener() + ~TestedNotificationsListener() override {} QHash& getApplications()