From d58f6314fe18a57e92a0b41f31ca32444d4402b4 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 8 Sep 2015 10:46:59 +0200 Subject: [PATCH] run Clang Modernize Minus the auto change --- core/backends/lan/downloadjob.h | 2 +- core/backends/lan/landevicelink.h | 4 ++-- core/backends/lan/lanlinkprovider.h | 10 +++++----- core/backends/lan/socketlinereader.h | 2 +- core/backends/lan/uploadjob.cpp | 2 +- core/backends/lan/uploadjob.h | 2 +- core/backends/loopback/loopbackdevicelink.h | 4 ++-- .../backends/loopback/loopbacklinkprovider.cpp | 4 ++-- core/backends/loopback/loopbacklinkprovider.h | 10 +++++----- core/kdeconnectplugin.cpp | 2 +- daemon/kdeconnectd.cpp | 4 ++-- fileitemactionplugin/sendfileitemaction.h | 2 +- interfaces/dbusinterfaces.h | 18 +++++++++--------- interfaces/devicesmodel.cpp | 2 +- interfaces/devicesmodel.h | 8 ++++---- interfaces/devicessortproxymodel.h | 6 +++--- interfaces/notificationsmodel.cpp | 6 +++--- interfaces/notificationsmodel.h | 8 ++++---- kcm/kcm.cpp | 8 ++++---- kio/kiokdeconnect.h | 8 ++++---- .../kdeconnectdeclarativeplugin.h | 4 ++-- plasmoid/declarativeplugin/objectfactory.h | 12 ++++++------ plasmoid/declarativeplugin/processrunner.h | 2 +- plasmoid/declarativeplugin/responsewaiter.cpp | 4 ++-- plasmoid/declarativeplugin/responsewaiter.h | 2 +- plugins/battery/batteryplugin.h | 4 ++-- plugins/clipboard/clipboardplugin.h | 4 ++-- plugins/mousepad/mousepadplugin.cpp | 4 ++-- plugins/mousepad/mousepadplugin.h | 4 ++-- plugins/mpriscontrol/mpriscontrolplugin.h | 4 ++-- plugins/notifications/notificationsplugin.h | 4 ++-- plugins/pausemusic/pausemusic_config.h | 6 +++--- plugins/pausemusic/pausemusicplugin.h | 4 ++-- plugins/ping/pingplugin.h | 4 ++-- .../screensaverinhibitplugin.cpp | 2 +- .../screensaverinhibitplugin.h | 4 ++-- plugins/sftp/mounter.cpp | 2 +- plugins/sftp/sftpplugin.cpp | 6 +++--- plugins/sftp/sftpplugin.h | 4 ++-- plugins/share/share_config.h | 6 +++--- plugins/share/shareplugin.h | 4 ++-- plugins/telephony/telephonyplugin.cpp | 6 +++--- plugins/telephony/telephonyplugin.h | 4 ++-- tests/testsocketlinereader.cpp | 2 +- 44 files changed, 107 insertions(+), 107 deletions(-) diff --git a/core/backends/lan/downloadjob.h b/core/backends/lan/downloadjob.h index eeeab07a0..544e33cd4 100644 --- a/core/backends/lan/downloadjob.h +++ b/core/backends/lan/downloadjob.h @@ -35,7 +35,7 @@ class DownloadJob Q_OBJECT public: DownloadJob(QHostAddress address, QVariantMap transferInfo); - virtual void start(); + virtual void start() override; QSharedPointer getPayload(); private: diff --git a/core/backends/lan/landevicelink.h b/core/backends/lan/landevicelink.h index 7d31881fb..b16daa27f 100644 --- a/core/backends/lan/landevicelink.h +++ b/core/backends/lan/landevicelink.h @@ -37,8 +37,8 @@ class LanDeviceLink public: LanDeviceLink(const QString& deviceId, LinkProvider* parent, QTcpSocket* socket); - bool sendPackage(NetworkPackage& np); - bool sendPackageEncrypted(QCA::PublicKey& key, NetworkPackage& np); + bool sendPackage(NetworkPackage& np) override; + bool sendPackageEncrypted(QCA::PublicKey& key, NetworkPackage& np) override; private Q_SLOTS: void dataReceived(); diff --git a/core/backends/lan/lanlinkprovider.h b/core/backends/lan/lanlinkprovider.h index b379434bd..81f2f75da 100644 --- a/core/backends/lan/lanlinkprovider.h +++ b/core/backends/lan/lanlinkprovider.h @@ -37,13 +37,13 @@ public: LanLinkProvider(); ~LanLinkProvider(); - QString name() { return "LanLinkProvider"; } - int priority() { return PRIORITY_HIGH; } + QString name() override { return "LanLinkProvider"; } + int priority() override { return PRIORITY_HIGH; } public Q_SLOTS: - virtual void onNetworkChange(); - virtual void onStart(); - virtual void onStop(); + virtual void onNetworkChange() override; + virtual void onStart() override; + virtual void onStop() override; void connected(); void connectError(); diff --git a/core/backends/lan/socketlinereader.h b/core/backends/lan/socketlinereader.h index 29b059a74..e021ea8ab 100644 --- a/core/backends/lan/socketlinereader.h +++ b/core/backends/lan/socketlinereader.h @@ -37,7 +37,7 @@ class SocketLineReader Q_OBJECT public: - explicit SocketLineReader(QTcpSocket* socket, QObject* parent = 0); + explicit SocketLineReader(QTcpSocket* socket, QObject* parent = nullptr); QByteArray readLine() { return mPackages.dequeue(); } qint64 write(const QByteArray& data) { return mSocket->write(data); } diff --git a/core/backends/lan/uploadjob.cpp b/core/backends/lan/uploadjob.cpp index 90978f22a..acc35fcdb 100644 --- a/core/backends/lan/uploadjob.cpp +++ b/core/backends/lan/uploadjob.cpp @@ -29,7 +29,7 @@ UploadJob::UploadJob(const QSharedPointer& source): KJob() { mInput = source; mServer = new QTcpServer(this); - mSocket = 0; + mSocket = nullptr; mPort = 0; connect(mInput.data(), SIGNAL(readyRead()), this, SLOT(readyRead())); diff --git a/core/backends/lan/uploadjob.h b/core/backends/lan/uploadjob.h index 40056b3a8..9722cc260 100644 --- a/core/backends/lan/uploadjob.h +++ b/core/backends/lan/uploadjob.h @@ -35,7 +35,7 @@ class UploadJob Q_OBJECT public: explicit UploadJob(const QSharedPointer& source); - virtual void start(); + virtual void start() override; QVariantMap getTransferInfo(); private: diff --git a/core/backends/loopback/loopbackdevicelink.h b/core/backends/loopback/loopbackdevicelink.h index 9d1ae14e6..84adeeb93 100644 --- a/core/backends/loopback/loopbackdevicelink.h +++ b/core/backends/loopback/loopbackdevicelink.h @@ -32,8 +32,8 @@ class LoopbackDeviceLink public: LoopbackDeviceLink(const QString& d, LoopbackLinkProvider* a); - virtual bool sendPackage(NetworkPackage& np); - virtual bool sendPackageEncrypted(QCA::PublicKey& publicKey, NetworkPackage& np); + virtual bool sendPackage(NetworkPackage& np) override; + virtual bool sendPackageEncrypted(QCA::PublicKey& publicKey, NetworkPackage& np) override; }; diff --git a/core/backends/loopback/loopbacklinkprovider.cpp b/core/backends/loopback/loopbacklinkprovider.cpp index 5442c82b5..6a18ece33 100644 --- a/core/backends/loopback/loopbacklinkprovider.cpp +++ b/core/backends/loopback/loopbacklinkprovider.cpp @@ -25,7 +25,7 @@ LoopbackLinkProvider::LoopbackLinkProvider() : identityPackage(PACKAGE_TYPE_IDENTITY) { - loopbackDeviceLink = 0; + loopbackDeviceLink = nullptr; NetworkPackage::createIdentityPackage(&identityPackage); } @@ -55,7 +55,7 @@ void LoopbackLinkProvider::onStop() { if (loopbackDeviceLink) { delete loopbackDeviceLink; - loopbackDeviceLink = 0; + loopbackDeviceLink = nullptr; } } diff --git a/core/backends/loopback/loopbacklinkprovider.h b/core/backends/loopback/loopbacklinkprovider.h index 9dcb5296e..82660502b 100644 --- a/core/backends/loopback/loopbacklinkprovider.h +++ b/core/backends/loopback/loopbacklinkprovider.h @@ -32,12 +32,12 @@ public: LoopbackLinkProvider(); ~LoopbackLinkProvider(); - QString name() { return "LoopbackLinkProvider"; } - int priority() { return PRIORITY_LOW; } + QString name() override { return "LoopbackLinkProvider"; } + int priority() override { return PRIORITY_LOW; } - virtual void onStart(); - virtual void onStop(); - virtual void onNetworkChange(); + virtual void onStart() override; + virtual void onStop() override; + virtual void onNetworkChange() override; private: LoopbackDeviceLink* loopbackDeviceLink; diff --git a/core/kdeconnectplugin.cpp b/core/kdeconnectplugin.cpp index ac83e65d9..f9dc21dbd 100644 --- a/core/kdeconnectplugin.cpp +++ b/core/kdeconnectplugin.cpp @@ -37,7 +37,7 @@ KdeConnectPlugin::KdeConnectPlugin(QObject* parent, const QVariantList& args) d->mDevice = qvariant_cast< Device* >(args.at(0)); d->mPluginName = args.at(1).toString(); d->mOutgoingTypes = args.at(2).toStringList().toSet(); - d->mConfig = 0; + d->mConfig = nullptr; } KdeConnectPluginConfig* KdeConnectPlugin::config() const diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index e71f88f31..06a709e42 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -58,8 +58,8 @@ void initializeTermHandlers(QCoreApplication* app, Daemon* daemon) sigemptyset(&action.sa_mask); action.sa_flags = 0; - sigaction(SIGTERM, &action, NULL); - sigaction(SIGINT, &action, NULL); + sigaction(SIGTERM, &action, nullptr); + sigaction(SIGINT, &action, nullptr); } class DesktopDaemon : public Daemon diff --git a/fileitemactionplugin/sendfileitemaction.h b/fileitemactionplugin/sendfileitemaction.h index 21ad1fb8b..da73597a7 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); + virtual 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 6d24d9bf9..b85a313c9 100644 --- a/interfaces/dbusinterfaces.h +++ b/interfaces/dbusinterfaces.h @@ -42,7 +42,7 @@ class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface { Q_OBJECT public: - explicit DaemonDbusInterface(QObject* parent = 0); + explicit DaemonDbusInterface(QObject* parent = nullptr); virtual ~DaemonDbusInterface(); static QString activatedService(); @@ -57,7 +57,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy) public: - explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~DeviceDbusInterface(); Q_SCRIPTABLE QString id() const; @@ -75,7 +75,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceBatteryDbusInterface { Q_OBJECT public: - explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~DeviceBatteryDbusInterface(); }; @@ -84,7 +84,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceNotificationsDbusInterface { Q_OBJECT public: - explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~DeviceNotificationsDbusInterface(); }; @@ -93,7 +93,7 @@ class KDECONNECTINTERFACES_EXPORT NotificationDbusInterface { Q_OBJECT public: - NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = 0); + NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = nullptr); virtual ~NotificationDbusInterface(); }; @@ -102,7 +102,7 @@ class KDECONNECTINTERFACES_EXPORT SftpDbusInterface { Q_OBJECT public: - explicit SftpDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit SftpDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~SftpDbusInterface(); }; @@ -119,7 +119,7 @@ class KDECONNECTINTERFACES_EXPORT MprisDbusInterface Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY propertiesChangedProxy) Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy) public: - explicit MprisDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit MprisDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~MprisDbusInterface(); Q_SIGNALS: @@ -131,7 +131,7 @@ class KDECONNECTINTERFACES_EXPORT RemoteControlDbusInterface { Q_OBJECT public: - explicit RemoteControlDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit RemoteControlDbusInterface(const QString& deviceId, QObject* parent = nullptr); ~RemoteControlDbusInterface() override; }; @@ -141,7 +141,7 @@ class KDECONNECTINTERFACES_EXPORT LockDeviceDbusInterface Q_OBJECT Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy) public: - explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = 0); + explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr); virtual ~LockDeviceDbusInterface(); Q_SIGNALS: diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp index 448343e2e..9b30ce817 100644 --- a/interfaces/devicesmodel.cpp +++ b/interfaces/devicesmodel.cpp @@ -267,7 +267,7 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const DeviceDbusInterface* DevicesModel::getDevice(int row) const { if (row < 0 || row >= m_deviceList.size()) { - return NULL; + return nullptr; } return m_deviceList[row]; diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h index 625302582..283a41d72 100644 --- a/interfaces/devicesmodel.h +++ b/interfaces/devicesmodel.h @@ -57,17 +57,17 @@ public: Q_FLAGS(StatusFilterFlags) Q_ENUMS(StatusFilterFlag) - explicit DevicesModel(QObject *parent = 0); + explicit DevicesModel(QObject *parent = nullptr); virtual ~DevicesModel(); void setDisplayFilter(int flags); int displayFilter() const; - virtual QVariant data(const QModelIndex& index, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role) const override; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; Q_SCRIPTABLE DeviceDbusInterface* getDevice(int row) const; - virtual QHash roleNames() const; + virtual QHash roleNames() const override; private Q_SLOTS: void deviceAdded(const QString& id); diff --git a/interfaces/devicessortproxymodel.h b/interfaces/devicessortproxymodel.h index 126112f88..f248f36eb 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; - virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; - virtual void setSourceModel(QAbstractItemModel *sourceModel); + 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; public Q_SLOTS: void sourceDataChanged(QModelIndex,QModelIndex); diff --git a/interfaces/notificationsmodel.cpp b/interfaces/notificationsmodel.cpp index 754502173..3f204f19e 100644 --- a/interfaces/notificationsmodel.cpp +++ b/interfaces/notificationsmodel.cpp @@ -32,7 +32,7 @@ NotificationsModel::NotificationsModel(QObject* parent) : QAbstractListModel(parent) - , m_dbusInterface(0) + , m_dbusInterface(nullptr) { //new ModelTest(this, this); @@ -191,12 +191,12 @@ QVariant NotificationsModel::data(const QModelIndex& index, int role) const NotificationDbusInterface* NotificationsModel::getNotification(const QModelIndex& index) const { if (!index.isValid()) { - return NULL; + return nullptr; } int row = index.row(); if (row < 0 || row >= m_notificationList.size()) { - return NULL; + return nullptr; } return m_notificationList[row]; diff --git a/interfaces/notificationsmodel.h b/interfaces/notificationsmodel.h index a4ec4f38c..e8351c8b6 100644 --- a/interfaces/notificationsmodel.h +++ b/interfaces/notificationsmodel.h @@ -47,19 +47,19 @@ public: DbusInterfaceRole, }; - explicit NotificationsModel(QObject* parent = 0); + explicit NotificationsModel(QObject* parent = nullptr); virtual ~NotificationsModel(); QString deviceId() const; void setDeviceId(const QString& deviceId); - virtual QVariant data(const QModelIndex& index, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role) const override; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; NotificationDbusInterface* getNotification(const QModelIndex& index) const; Q_INVOKABLE bool isAnyDimissable() const; - virtual QHash roleNames() const; + virtual QHash roleNames() const override; public Q_SLOTS: void dismissAll(); diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index ac66dc02b..9e5920c0b 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -49,7 +49,7 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&) , kcmUi(new Ui::KdeConnectKcmUi()) , daemon(new DaemonDbusInterface(this)) , devicesModel(new DevicesModel(this)) - , currentDevice(0) + , currentDevice(nullptr) { KAboutData *about = new KAboutData("kdeconnect-kcm", i18n("KDE Connect Settings"), @@ -165,7 +165,7 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current) pluginsConfigChanged(); if (!current.isValid()) { - currentDevice = NULL; + currentDevice = nullptr; kcmUi->deviceInfo->setVisible(false); return; } @@ -173,7 +173,7 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current) currentIndex = sortProxyModel->mapToSource(current); currentDevice = devicesModel->getDevice(currentIndex.row()); - bool valid = (currentDevice != NULL && currentDevice->isValid()); + bool valid = (currentDevice != nullptr && currentDevice->isValid()); kcmUi->deviceInfo->setVisible(valid); if (!valid) { return; @@ -274,7 +274,7 @@ void KdeConnectKcm::pluginsConfigChanged() if (!currentDevice) return; DeviceDbusInterface* auxCurrentDevice = currentDevice; - currentDevice = 0; //HACK to avoid infinite recursion (for some reason calling save on pluginselector emits changed) + currentDevice = nullptr; //HACK to avoid infinite recursion (for some reason calling save on pluginselector emits changed) kcmUi->pluginSelector->save(); currentDevice = auxCurrentDevice; diff --git a/kio/kiokdeconnect.h b/kio/kiokdeconnect.h index f655cb226..c30195877 100644 --- a/kio/kiokdeconnect.h +++ b/kio/kiokdeconnect.h @@ -37,11 +37,11 @@ class KioKdeconnect : public QObject, public KIO::SlaveBase public: KioKdeconnect(const QByteArray &pool, const QByteArray &app); - void get(const QUrl &url); - void listDir(const QUrl &url); - void stat(const QUrl &url); + void get(const QUrl &url) override; + void listDir(const QUrl &url) override; + void stat(const QUrl &url) override; - void setHost(const QString &constHostname, quint16 port, const QString &user, const QString &pass); + void setHost(const QString &constHostname, quint16 port, const QString &user, const QString &pass) override; void listAllDevices(); //List all devices exported by m_dbusInterface void listDevice(); //List m_currentDevice diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h index 85d0cf04f..1944dc6ec 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); - virtual void initializeEngine(QQmlEngine *engine, const char *uri); + virtual void registerTypes(const char* uri) override; + virtual void initializeEngine(QQmlEngine *engine, const char *uri) override; }; #endif // KDECONNECTDECLARATIVEPLUGIN_H diff --git a/plasmoid/declarativeplugin/objectfactory.h b/plasmoid/declarativeplugin/objectfactory.h index 0a4a8ca53..f64504729 100644 --- a/plasmoid/declarativeplugin/objectfactory.h +++ b/plasmoid/declarativeplugin/objectfactory.h @@ -15,25 +15,25 @@ class ObjectFactory : public QObject typedef QObject* (*Func2)(QVariant, QVariant); public: - ObjectFactory(QObject* parent, Func0 f0) : QObject(parent), m_f0(f0), m_f1(0), m_f2(0) {} - ObjectFactory(QObject* parent, Func1 f1) : QObject(parent), m_f0(0), m_f1(f1), m_f2(0) {} - ObjectFactory(QObject* parent, Func2 f2) : QObject(parent), m_f0(0), m_f1(0), m_f2(f2) {} + ObjectFactory(QObject* parent, Func0 f0) : QObject(parent), m_f0(f0), m_f1(nullptr), m_f2(nullptr) {} + 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() {} Q_INVOKABLE QObject* create() { - if (m_f0) return m_f0(); return 0; + if (m_f0) return m_f0(); return nullptr; } Q_INVOKABLE QObject* create(QVariant arg1) { if (m_f1) return m_f1(arg1); - return 0; + return nullptr; } Q_INVOKABLE QObject* create(QVariant arg1, QVariant arg2) { if (m_f2) return m_f2(arg1, arg2); - return 0; + return nullptr; } private: diff --git a/plasmoid/declarativeplugin/processrunner.h b/plasmoid/declarativeplugin/processrunner.h index ff314a16a..27cfa6cdd 100644 --- a/plasmoid/declarativeplugin/processrunner.h +++ b/plasmoid/declarativeplugin/processrunner.h @@ -27,7 +27,7 @@ class ProcessRunner : public QObject Q_OBJECT public: - explicit ProcessRunner(QObject *parent = 0); + explicit ProcessRunner(QObject *parent = nullptr); ~ProcessRunner(); Q_INVOKABLE void runKdeconnectKCM(); diff --git a/plasmoid/declarativeplugin/responsewaiter.cpp b/plasmoid/declarativeplugin/responsewaiter.cpp index 79892cb2c..f2c9bf3e8 100644 --- a/plasmoid/declarativeplugin/responsewaiter.cpp +++ b/plasmoid/declarativeplugin/responsewaiter.cpp @@ -11,7 +11,7 @@ Q_DECLARE_METATYPE(QDBusPendingReply) Q_DECLARE_METATYPE(QDBusPendingReply) Q_DECLARE_METATYPE(QDBusPendingReply) -DBusResponseWaiter* DBusResponseWaiter::m_instance = 0; +DBusResponseWaiter* DBusResponseWaiter::m_instance = nullptr; DBusResponseWaiter* DBusResponseWaiter::instance() { @@ -124,7 +124,7 @@ const QDBusPendingCall* DBusResponseWaiter::extractPendingCall(QVariant& variant } } - return 0; + return nullptr; } diff --git a/plasmoid/declarativeplugin/responsewaiter.h b/plasmoid/declarativeplugin/responsewaiter.h index 365e93585..e85b41855 100644 --- a/plasmoid/declarativeplugin/responsewaiter.h +++ b/plasmoid/declarativeplugin/responsewaiter.h @@ -36,7 +36,7 @@ class DBusAsyncResponse : public QObject Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete) public: - explicit DBusAsyncResponse(QObject* parent = 0); + explicit DBusAsyncResponse(QObject* parent = nullptr); virtual ~DBusAsyncResponse() {}; Q_INVOKABLE void setPendingCall(QVariant e); diff --git a/plugins/battery/batteryplugin.h b/plugins/battery/batteryplugin.h index d1c2e54f8..c643f04f9 100644 --- a/plugins/battery/batteryplugin.h +++ b/plugins/battery/batteryplugin.h @@ -39,8 +39,8 @@ public: virtual ~BatteryPlugin(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual 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 12d34c227..7edcebe29 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); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override { } private Q_SLOTS: void clipboardChanged(QClipboard::Mode mode); diff --git a/plugins/mousepad/mousepadplugin.cpp b/plugins/mousepad/mousepadplugin.cpp index 86a7a7f14..cc172ab1f 100644 --- a/plugins/mousepad/mousepadplugin.cpp +++ b/plugins/mousepad/mousepadplugin.cpp @@ -86,7 +86,7 @@ template size_t arraySize(T(&arr)[N]) { (void)arr; return N; } MousepadPlugin::MousepadPlugin(QObject* parent, const QVariantList& args) - : KdeConnectPlugin(parent, args), m_fakekey(0), m_x11(QX11Info::isPlatformX11()) + : KdeConnectPlugin(parent, args), m_fakekey(nullptr), m_x11(QX11Info::isPlatformX11()) #if HAVE_WAYLAND , m_waylandInput(nullptr) , m_waylandAuthenticationRequested(false) @@ -101,7 +101,7 @@ MousepadPlugin::~MousepadPlugin() { if (m_fakekey) { free(m_fakekey); - m_fakekey = 0; + m_fakekey = nullptr; } } diff --git a/plugins/mousepad/mousepadplugin.h b/plugins/mousepad/mousepadplugin.h index 0c4998844..110f58e28 100644 --- a/plugins/mousepad/mousepadplugin.h +++ b/plugins/mousepad/mousepadplugin.h @@ -48,8 +48,8 @@ public: explicit MousepadPlugin(QObject *parent, const QVariantList &args); virtual ~MousepadPlugin(); - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override { } private: bool handlePackageX11(const NetworkPackage& np); diff --git a/plugins/mpriscontrol/mpriscontrolplugin.h b/plugins/mpriscontrol/mpriscontrolplugin.h index 60bcd1a7c..de5f301b1 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); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override { } private Q_SLOTS: void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties); diff --git a/plugins/notifications/notificationsplugin.h b/plugins/notifications/notificationsplugin.h index a2e782802..7cc67c5f4 100644 --- a/plugins/notifications/notificationsplugin.h +++ b/plugins/notifications/notificationsplugin.h @@ -43,8 +43,8 @@ public: virtual ~NotificationsPlugin(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private: NotificationsDbusInterface* notificationsDbusInterface; diff --git a/plugins/pausemusic/pausemusic_config.h b/plugins/pausemusic/pausemusic_config.h index 180ebaf21..002e39e8b 100644 --- a/plugins/pausemusic/pausemusic_config.h +++ b/plugins/pausemusic/pausemusic_config.h @@ -36,9 +36,9 @@ public: virtual ~PauseMusicConfig(); public Q_SLOTS: - virtual void save(); - virtual void load(); - virtual void defaults(); + virtual void save() override; + virtual void load() override; + virtual void defaults() override; private: Ui::PauseMusicConfigUi* m_ui; diff --git a/plugins/pausemusic/pausemusicplugin.h b/plugins/pausemusic/pausemusicplugin.h index 76c08c02f..404e2341d 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); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual 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 3217dcdab..d122c5c2d 100644 --- a/plugins/ping/pingplugin.h +++ b/plugins/ping/pingplugin.h @@ -41,8 +41,8 @@ public: Q_SCRIPTABLE void sendPing(const QString& customMessage); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private: QString dbusPath() const; diff --git a/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp b/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp index 49faebed3..122153a9f 100644 --- a/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp +++ b/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp @@ -46,7 +46,7 @@ ScreensaverInhibitPlugin::ScreensaverInhibitPlugin(QObject* parent, const QVaria QDBusMessage reply = inhibitInterface.call(INHIBIT_METHOD, "kdeconnect", "Phone is connected"); - if (reply.errorMessage() != NULL) { + if (reply.errorMessage() != nullptr) { qCDebug(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT) << "Unable to inhibit the screensaver: " << reply.errorMessage(); inhibitCookie = 0; } else { diff --git a/plugins/screensaver-inhibit/screensaverinhibitplugin.h b/plugins/screensaver-inhibit/screensaverinhibitplugin.h index d2efeca37..5589ad494 100644 --- a/plugins/screensaver-inhibit/screensaverinhibitplugin.h +++ b/plugins/screensaver-inhibit/screensaverinhibitplugin.h @@ -35,8 +35,8 @@ public: virtual ~ScreensaverInhibitPlugin(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private: uint inhibitCookie; diff --git a/plugins/sftp/mounter.cpp b/plugins/sftp/mounter.cpp index 9241b180d..b83e55f85 100644 --- a/plugins/sftp/mounter.cpp +++ b/plugins/sftp/mounter.cpp @@ -32,7 +32,7 @@ Mounter::Mounter(SftpPlugin* sftp) : QObject(sftp) , m_sftp(sftp) - , m_proc(0) + , m_proc(nullptr) , m_mountPoint(sftp->mountPoint()) , m_started(false) { diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp index 981dd09ba..fd29ae35a 100644 --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -41,7 +41,7 @@ static const QSet fields_c = QSet() << "ip" << "port" << "user struct SftpPlugin::Pimpl { - Pimpl() : mounter(0) {} + Pimpl() : mounter(nullptr) {} //Add KIO entry to Dolphin's Places KFilePlacesModel placesModel; @@ -105,7 +105,7 @@ void SftpPlugin::unmount() if (m_d->mounter) { m_d->mounter->deleteLater(); - m_d->mounter = 0; + m_d->mounter = nullptr; } } @@ -124,7 +124,7 @@ bool SftpPlugin::startBrowsing() { if (mountAndWait()) { //return new KRun(QUrl::fromLocalFile(mountPoint()), 0); - return new KRun(QUrl("kdeconnect://"+deviceId), 0); + return new KRun(QUrl("kdeconnect://"+deviceId), nullptr); } return false; } diff --git a/plugins/sftp/sftpplugin.h b/plugins/sftp/sftpplugin.h index 48d89528d..011ed22ce 100644 --- a/plugins/sftp/sftpplugin.h +++ b/plugins/sftp/sftpplugin.h @@ -44,8 +44,8 @@ Q_SIGNALS: Q_SCRIPTABLE void unmounted(); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; Q_SCRIPTABLE void mount(); Q_SCRIPTABLE void unmount(); diff --git a/plugins/share/share_config.h b/plugins/share/share_config.h index b3f837cb5..f4ecadf4a 100644 --- a/plugins/share/share_config.h +++ b/plugins/share/share_config.h @@ -36,9 +36,9 @@ public: virtual ~ShareConfig(); public Q_SLOTS: - virtual void save(); - virtual void load(); - virtual void defaults(); + virtual void save() override; + virtual void load() override; + virtual void defaults() override; private: Ui::ShareConfigUi* m_ui; diff --git a/plugins/share/shareplugin.h b/plugins/share/shareplugin.h index de00693d1..09b78f697 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); - virtual void connected(); + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override; private Q_SLOTS: void finished(KJob*); diff --git a/plugins/telephony/telephonyplugin.cpp b/plugins/telephony/telephonyplugin.cpp index c81498fe5..ea807a77d 100644 --- a/plugins/telephony/telephonyplugin.cpp +++ b/plugins/telephony/telephonyplugin.cpp @@ -64,10 +64,10 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np) content = i18n("SMS from %1
%2", phoneNumber, messageBody); flags = KNotification::Persistent; } else if (event == "talking") { - return NULL; + return nullptr; } else { #ifndef NDEBUG - return NULL; + return nullptr; #else type = QStringLiteral("callReceived"); icon = QStringLiteral("phone"); @@ -103,7 +103,7 @@ bool TelephonyPlugin::receivePackage(const NetworkPackage& np) } else { KNotification* n = createNotification(np); - if (n != NULL) n->sendEvent(); + if (n != nullptr) n->sendEvent(); } diff --git a/plugins/telephony/telephonyplugin.h b/plugins/telephony/telephonyplugin.h index ce74e9e2f..2898f220a 100644 --- a/plugins/telephony/telephonyplugin.h +++ b/plugins/telephony/telephonyplugin.h @@ -40,8 +40,8 @@ public: explicit TelephonyPlugin(QObject *parent, const QVariantList &args); public Q_SLOTS: - virtual bool receivePackage(const NetworkPackage& np); - virtual void connected() { } + virtual bool receivePackage(const NetworkPackage& np) override; + virtual void connected() override { } void sendMutePackage(); private: diff --git a/tests/testsocketlinereader.cpp b/tests/testsocketlinereader.cpp index 77a9b4bf2..7894d6962 100644 --- a/tests/testsocketlinereader.cpp +++ b/tests/testsocketlinereader.cpp @@ -80,7 +80,7 @@ void TestSocketLineReader::socketLineReader() QTcpSocket *sock = mServer->nextPendingConnection(); - QVERIFY2(sock != 0, "Could not open a connection to the client"); + QVERIFY2(sock != nullptr, "Could not open a connection to the client"); mReader = new SocketLineReader(sock, this); connect(mReader, SIGNAL(readyRead()), SLOT(newPackage()));