run Clang Modernize

Minus the auto change
This commit is contained in:
Aleix Pol 2015-09-08 10:46:59 +02:00
parent 9ca9833e9c
commit d58f6314fe
44 changed files with 107 additions and 107 deletions

View file

@ -35,7 +35,7 @@ class DownloadJob
Q_OBJECT Q_OBJECT
public: public:
DownloadJob(QHostAddress address, QVariantMap transferInfo); DownloadJob(QHostAddress address, QVariantMap transferInfo);
virtual void start(); virtual void start() override;
QSharedPointer<QIODevice> getPayload(); QSharedPointer<QIODevice> getPayload();
private: private:

View file

@ -37,8 +37,8 @@ class LanDeviceLink
public: public:
LanDeviceLink(const QString& deviceId, LinkProvider* parent, QTcpSocket* socket); LanDeviceLink(const QString& deviceId, LinkProvider* parent, QTcpSocket* socket);
bool sendPackage(NetworkPackage& np); bool sendPackage(NetworkPackage& np) override;
bool sendPackageEncrypted(QCA::PublicKey& key, NetworkPackage& np); bool sendPackageEncrypted(QCA::PublicKey& key, NetworkPackage& np) override;
private Q_SLOTS: private Q_SLOTS:
void dataReceived(); void dataReceived();

View file

@ -37,13 +37,13 @@ public:
LanLinkProvider(); LanLinkProvider();
~LanLinkProvider(); ~LanLinkProvider();
QString name() { return "LanLinkProvider"; } QString name() override { return "LanLinkProvider"; }
int priority() { return PRIORITY_HIGH; } int priority() override { return PRIORITY_HIGH; }
public Q_SLOTS: public Q_SLOTS:
virtual void onNetworkChange(); virtual void onNetworkChange() override;
virtual void onStart(); virtual void onStart() override;
virtual void onStop(); virtual void onStop() override;
void connected(); void connected();
void connectError(); void connectError();

View file

@ -37,7 +37,7 @@ class SocketLineReader
Q_OBJECT Q_OBJECT
public: public:
explicit SocketLineReader(QTcpSocket* socket, QObject* parent = 0); explicit SocketLineReader(QTcpSocket* socket, QObject* parent = nullptr);
QByteArray readLine() { return mPackages.dequeue(); } QByteArray readLine() { return mPackages.dequeue(); }
qint64 write(const QByteArray& data) { return mSocket->write(data); } qint64 write(const QByteArray& data) { return mSocket->write(data); }

View file

@ -29,7 +29,7 @@ UploadJob::UploadJob(const QSharedPointer<QIODevice>& source): KJob()
{ {
mInput = source; mInput = source;
mServer = new QTcpServer(this); mServer = new QTcpServer(this);
mSocket = 0; mSocket = nullptr;
mPort = 0; mPort = 0;
connect(mInput.data(), SIGNAL(readyRead()), this, SLOT(readyRead())); connect(mInput.data(), SIGNAL(readyRead()), this, SLOT(readyRead()));

View file

@ -35,7 +35,7 @@ class UploadJob
Q_OBJECT Q_OBJECT
public: public:
explicit UploadJob(const QSharedPointer<QIODevice>& source); explicit UploadJob(const QSharedPointer<QIODevice>& source);
virtual void start(); virtual void start() override;
QVariantMap getTransferInfo(); QVariantMap getTransferInfo();
private: private:

View file

@ -32,8 +32,8 @@ class LoopbackDeviceLink
public: public:
LoopbackDeviceLink(const QString& d, LoopbackLinkProvider* a); LoopbackDeviceLink(const QString& d, LoopbackLinkProvider* a);
virtual bool sendPackage(NetworkPackage& np); virtual bool sendPackage(NetworkPackage& np) override;
virtual bool sendPackageEncrypted(QCA::PublicKey& publicKey, NetworkPackage& np); virtual bool sendPackageEncrypted(QCA::PublicKey& publicKey, NetworkPackage& np) override;
}; };

View file

@ -25,7 +25,7 @@
LoopbackLinkProvider::LoopbackLinkProvider() LoopbackLinkProvider::LoopbackLinkProvider()
: identityPackage(PACKAGE_TYPE_IDENTITY) : identityPackage(PACKAGE_TYPE_IDENTITY)
{ {
loopbackDeviceLink = 0; loopbackDeviceLink = nullptr;
NetworkPackage::createIdentityPackage(&identityPackage); NetworkPackage::createIdentityPackage(&identityPackage);
} }
@ -55,7 +55,7 @@ void LoopbackLinkProvider::onStop()
{ {
if (loopbackDeviceLink) { if (loopbackDeviceLink) {
delete loopbackDeviceLink; delete loopbackDeviceLink;
loopbackDeviceLink = 0; loopbackDeviceLink = nullptr;
} }
} }

View file

@ -32,12 +32,12 @@ public:
LoopbackLinkProvider(); LoopbackLinkProvider();
~LoopbackLinkProvider(); ~LoopbackLinkProvider();
QString name() { return "LoopbackLinkProvider"; } QString name() override { return "LoopbackLinkProvider"; }
int priority() { return PRIORITY_LOW; } int priority() override { return PRIORITY_LOW; }
virtual void onStart(); virtual void onStart() override;
virtual void onStop(); virtual void onStop() override;
virtual void onNetworkChange(); virtual void onNetworkChange() override;
private: private:
LoopbackDeviceLink* loopbackDeviceLink; LoopbackDeviceLink* loopbackDeviceLink;

View file

@ -37,7 +37,7 @@ KdeConnectPlugin::KdeConnectPlugin(QObject* parent, const QVariantList& args)
d->mDevice = qvariant_cast< Device* >(args.at(0)); d->mDevice = qvariant_cast< Device* >(args.at(0));
d->mPluginName = args.at(1).toString(); d->mPluginName = args.at(1).toString();
d->mOutgoingTypes = args.at(2).toStringList().toSet(); d->mOutgoingTypes = args.at(2).toStringList().toSet();
d->mConfig = 0; d->mConfig = nullptr;
} }
KdeConnectPluginConfig* KdeConnectPlugin::config() const KdeConnectPluginConfig* KdeConnectPlugin::config() const

View file

@ -58,8 +58,8 @@ void initializeTermHandlers(QCoreApplication* app, Daemon* daemon)
sigemptyset(&action.sa_mask); sigemptyset(&action.sa_mask);
action.sa_flags = 0; action.sa_flags = 0;
sigaction(SIGTERM, &action, NULL); sigaction(SIGTERM, &action, nullptr);
sigaction(SIGINT, &action, NULL); sigaction(SIGINT, &action, nullptr);
} }
class DesktopDaemon : public Daemon class DesktopDaemon : public Daemon

View file

@ -35,7 +35,7 @@ class SendFileItemAction : public KAbstractFileItemActionPlugin
Q_OBJECT Q_OBJECT
public: public:
SendFileItemAction(QObject* parent, const QVariantList &args); 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: private Q_SLOTS:
void sendFile(); void sendFile();

View file

@ -42,7 +42,7 @@ class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DaemonDbusInterface(QObject* parent = 0); explicit DaemonDbusInterface(QObject* parent = nullptr);
virtual ~DaemonDbusInterface(); virtual ~DaemonDbusInterface();
static QString activatedService(); static QString activatedService();
@ -57,7 +57,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface
Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy) Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy)
public: public:
explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = 0); explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr);
virtual ~DeviceDbusInterface(); virtual ~DeviceDbusInterface();
Q_SCRIPTABLE QString id() const; Q_SCRIPTABLE QString id() const;
@ -75,7 +75,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceBatteryDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = 0); explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = nullptr);
virtual ~DeviceBatteryDbusInterface(); virtual ~DeviceBatteryDbusInterface();
}; };
@ -84,7 +84,7 @@ class KDECONNECTINTERFACES_EXPORT DeviceNotificationsDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = 0); explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = nullptr);
virtual ~DeviceNotificationsDbusInterface(); virtual ~DeviceNotificationsDbusInterface();
}; };
@ -93,7 +93,7 @@ class KDECONNECTINTERFACES_EXPORT NotificationDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = 0); NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = nullptr);
virtual ~NotificationDbusInterface(); virtual ~NotificationDbusInterface();
}; };
@ -102,7 +102,7 @@ class KDECONNECTINTERFACES_EXPORT SftpDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SftpDbusInterface(const QString& deviceId, QObject* parent = 0); explicit SftpDbusInterface(const QString& deviceId, QObject* parent = nullptr);
virtual ~SftpDbusInterface(); virtual ~SftpDbusInterface();
}; };
@ -119,7 +119,7 @@ class KDECONNECTINTERFACES_EXPORT MprisDbusInterface
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY propertiesChangedProxy) Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY propertiesChangedProxy)
Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy) Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy)
public: public:
explicit MprisDbusInterface(const QString& deviceId, QObject* parent = 0); explicit MprisDbusInterface(const QString& deviceId, QObject* parent = nullptr);
virtual ~MprisDbusInterface(); virtual ~MprisDbusInterface();
Q_SIGNALS: Q_SIGNALS:
@ -131,7 +131,7 @@ class KDECONNECTINTERFACES_EXPORT RemoteControlDbusInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit RemoteControlDbusInterface(const QString& deviceId, QObject* parent = 0); explicit RemoteControlDbusInterface(const QString& deviceId, QObject* parent = nullptr);
~RemoteControlDbusInterface() override; ~RemoteControlDbusInterface() override;
}; };
@ -141,7 +141,7 @@ class KDECONNECTINTERFACES_EXPORT LockDeviceDbusInterface
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy) Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy)
public: public:
explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = 0); explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr);
virtual ~LockDeviceDbusInterface(); virtual ~LockDeviceDbusInterface();
Q_SIGNALS: Q_SIGNALS:

View file

@ -267,7 +267,7 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
DeviceDbusInterface* DevicesModel::getDevice(int row) const DeviceDbusInterface* DevicesModel::getDevice(int row) const
{ {
if (row < 0 || row >= m_deviceList.size()) { if (row < 0 || row >= m_deviceList.size()) {
return NULL; return nullptr;
} }
return m_deviceList[row]; return m_deviceList[row];

View file

@ -57,17 +57,17 @@ public:
Q_FLAGS(StatusFilterFlags) Q_FLAGS(StatusFilterFlags)
Q_ENUMS(StatusFilterFlag) Q_ENUMS(StatusFilterFlag)
explicit DevicesModel(QObject *parent = 0); explicit DevicesModel(QObject *parent = nullptr);
virtual ~DevicesModel(); virtual ~DevicesModel();
void setDisplayFilter(int flags); void setDisplayFilter(int flags);
int displayFilter() const; int displayFilter() const;
virtual QVariant data(const QModelIndex& index, int role) const; virtual QVariant data(const QModelIndex& index, int role) const override;
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override;
Q_SCRIPTABLE DeviceDbusInterface* getDevice(int row) const; Q_SCRIPTABLE DeviceDbusInterface* getDevice(int row) const;
virtual QHash<int, QByteArray> roleNames() const; virtual QHash<int, QByteArray> roleNames() const override;
private Q_SLOTS: private Q_SLOTS:
void deviceAdded(const QString& id); void deviceAdded(const QString& id);

View file

@ -31,9 +31,9 @@ class KDECONNECTINTERFACES_EXPORT DevicesSortProxyModel : public QSortFilterProx
Q_OBJECT Q_OBJECT
public: public:
explicit DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR); explicit DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR);
virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const; virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
virtual void setSourceModel(QAbstractItemModel *sourceModel); virtual void setSourceModel(QAbstractItemModel *sourceModel) override;
public Q_SLOTS: public Q_SLOTS:
void sourceDataChanged(QModelIndex,QModelIndex); void sourceDataChanged(QModelIndex,QModelIndex);

View file

@ -32,7 +32,7 @@
NotificationsModel::NotificationsModel(QObject* parent) NotificationsModel::NotificationsModel(QObject* parent)
: QAbstractListModel(parent) : QAbstractListModel(parent)
, m_dbusInterface(0) , m_dbusInterface(nullptr)
{ {
//new ModelTest(this, this); //new ModelTest(this, this);
@ -191,12 +191,12 @@ QVariant NotificationsModel::data(const QModelIndex& index, int role) const
NotificationDbusInterface* NotificationsModel::getNotification(const QModelIndex& index) const NotificationDbusInterface* NotificationsModel::getNotification(const QModelIndex& index) const
{ {
if (!index.isValid()) { if (!index.isValid()) {
return NULL; return nullptr;
} }
int row = index.row(); int row = index.row();
if (row < 0 || row >= m_notificationList.size()) { if (row < 0 || row >= m_notificationList.size()) {
return NULL; return nullptr;
} }
return m_notificationList[row]; return m_notificationList[row];

View file

@ -47,19 +47,19 @@ public:
DbusInterfaceRole, DbusInterfaceRole,
}; };
explicit NotificationsModel(QObject* parent = 0); explicit NotificationsModel(QObject* parent = nullptr);
virtual ~NotificationsModel(); virtual ~NotificationsModel();
QString deviceId() const; QString deviceId() const;
void setDeviceId(const QString& deviceId); void setDeviceId(const QString& deviceId);
virtual QVariant data(const QModelIndex& index, int role) const; virtual QVariant data(const QModelIndex& index, int role) const override;
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override;
NotificationDbusInterface* getNotification(const QModelIndex& index) const; NotificationDbusInterface* getNotification(const QModelIndex& index) const;
Q_INVOKABLE bool isAnyDimissable() const; Q_INVOKABLE bool isAnyDimissable() const;
virtual QHash<int, QByteArray> roleNames() const; virtual QHash<int, QByteArray> roleNames() const override;
public Q_SLOTS: public Q_SLOTS:
void dismissAll(); void dismissAll();

View file

@ -49,7 +49,7 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
, kcmUi(new Ui::KdeConnectKcmUi()) , kcmUi(new Ui::KdeConnectKcmUi())
, daemon(new DaemonDbusInterface(this)) , daemon(new DaemonDbusInterface(this))
, devicesModel(new DevicesModel(this)) , devicesModel(new DevicesModel(this))
, currentDevice(0) , currentDevice(nullptr)
{ {
KAboutData *about = new KAboutData("kdeconnect-kcm", KAboutData *about = new KAboutData("kdeconnect-kcm",
i18n("KDE Connect Settings"), i18n("KDE Connect Settings"),
@ -165,7 +165,7 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
pluginsConfigChanged(); pluginsConfigChanged();
if (!current.isValid()) { if (!current.isValid()) {
currentDevice = NULL; currentDevice = nullptr;
kcmUi->deviceInfo->setVisible(false); kcmUi->deviceInfo->setVisible(false);
return; return;
} }
@ -173,7 +173,7 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
currentIndex = sortProxyModel->mapToSource(current); currentIndex = sortProxyModel->mapToSource(current);
currentDevice = devicesModel->getDevice(currentIndex.row()); currentDevice = devicesModel->getDevice(currentIndex.row());
bool valid = (currentDevice != NULL && currentDevice->isValid()); bool valid = (currentDevice != nullptr && currentDevice->isValid());
kcmUi->deviceInfo->setVisible(valid); kcmUi->deviceInfo->setVisible(valid);
if (!valid) { if (!valid) {
return; return;
@ -274,7 +274,7 @@ void KdeConnectKcm::pluginsConfigChanged()
if (!currentDevice) return; if (!currentDevice) return;
DeviceDbusInterface* auxCurrentDevice = currentDevice; 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(); kcmUi->pluginSelector->save();
currentDevice = auxCurrentDevice; currentDevice = auxCurrentDevice;

View file

@ -37,11 +37,11 @@ class KioKdeconnect : public QObject, public KIO::SlaveBase
public: public:
KioKdeconnect(const QByteArray &pool, const QByteArray &app); KioKdeconnect(const QByteArray &pool, const QByteArray &app);
void get(const QUrl &url); void get(const QUrl &url) override;
void listDir(const QUrl &url); void listDir(const QUrl &url) override;
void stat(const QUrl &url); 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 listAllDevices(); //List all devices exported by m_dbusInterface
void listDevice(); //List m_currentDevice void listDevice(); //List m_currentDevice

View file

@ -29,8 +29,8 @@ class KdeConnectDeclarativePlugin : public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
virtual void registerTypes(const char* uri); virtual void registerTypes(const char* uri) override;
virtual void initializeEngine(QQmlEngine *engine, const char *uri); virtual void initializeEngine(QQmlEngine *engine, const char *uri) override;
}; };
#endif // KDECONNECTDECLARATIVEPLUGIN_H #endif // KDECONNECTDECLARATIVEPLUGIN_H

View file

@ -15,25 +15,25 @@ class ObjectFactory : public QObject
typedef QObject* (*Func2)(QVariant, QVariant); typedef QObject* (*Func2)(QVariant, QVariant);
public: public:
ObjectFactory(QObject* parent, Func0 f0) : QObject(parent), m_f0(f0), m_f1(0), m_f2(0) {} 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(0), m_f1(f1), m_f2(0) {} 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(0), m_f1(0), m_f2(f2) {} ObjectFactory(QObject* parent, Func2 f2) : QObject(parent), m_f0(nullptr), m_f1(nullptr), m_f2(f2) {}
virtual ~ObjectFactory() {} virtual ~ObjectFactory() {}
Q_INVOKABLE QObject* create() { 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) { Q_INVOKABLE QObject* create(QVariant arg1) {
if (m_f1) return m_f1(arg1); if (m_f1) return m_f1(arg1);
return 0; return nullptr;
} }
Q_INVOKABLE QObject* create(QVariant arg1, QVariant arg2) { Q_INVOKABLE QObject* create(QVariant arg1, QVariant arg2) {
if (m_f2) return m_f2(arg1, arg2); if (m_f2) return m_f2(arg1, arg2);
return 0; return nullptr;
} }
private: private:

View file

@ -27,7 +27,7 @@ class ProcessRunner : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit ProcessRunner(QObject *parent = 0); explicit ProcessRunner(QObject *parent = nullptr);
~ProcessRunner(); ~ProcessRunner();
Q_INVOKABLE void runKdeconnectKCM(); Q_INVOKABLE void runKdeconnectKCM();

View file

@ -11,7 +11,7 @@ Q_DECLARE_METATYPE(QDBusPendingReply<bool>)
Q_DECLARE_METATYPE(QDBusPendingReply<int>) Q_DECLARE_METATYPE(QDBusPendingReply<int>)
Q_DECLARE_METATYPE(QDBusPendingReply<QString>) Q_DECLARE_METATYPE(QDBusPendingReply<QString>)
DBusResponseWaiter* DBusResponseWaiter::m_instance = 0; DBusResponseWaiter* DBusResponseWaiter::m_instance = nullptr;
DBusResponseWaiter* DBusResponseWaiter::instance() DBusResponseWaiter* DBusResponseWaiter::instance()
{ {
@ -124,7 +124,7 @@ const QDBusPendingCall* DBusResponseWaiter::extractPendingCall(QVariant& variant
} }
} }
return 0; return nullptr;
} }

View file

@ -36,7 +36,7 @@ class DBusAsyncResponse : public QObject
Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete) Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete)
public: public:
explicit DBusAsyncResponse(QObject* parent = 0); explicit DBusAsyncResponse(QObject* parent = nullptr);
virtual ~DBusAsyncResponse() {}; virtual ~DBusAsyncResponse() {};
Q_INVOKABLE void setPendingCall(QVariant e); Q_INVOKABLE void setPendingCall(QVariant e);

View file

@ -39,8 +39,8 @@ public:
virtual ~BatteryPlugin(); virtual ~BatteryPlugin();
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected(); virtual void connected() override;
private: private:
// Keep these values in sync with THRESHOLD* constants in // Keep these values in sync with THRESHOLD* constants in

View file

@ -38,8 +38,8 @@ public:
explicit ClipboardPlugin(QObject *parent, const QVariantList &args); explicit ClipboardPlugin(QObject *parent, const QVariantList &args);
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected() { } virtual void connected() override { }
private Q_SLOTS: private Q_SLOTS:
void clipboardChanged(QClipboard::Mode mode); void clipboardChanged(QClipboard::Mode mode);

View file

@ -86,7 +86,7 @@ template <typename T, size_t N>
size_t arraySize(T(&arr)[N]) { (void)arr; return N; } size_t arraySize(T(&arr)[N]) { (void)arr; return N; }
MousepadPlugin::MousepadPlugin(QObject* parent, const QVariantList& args) 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 #if HAVE_WAYLAND
, m_waylandInput(nullptr) , m_waylandInput(nullptr)
, m_waylandAuthenticationRequested(false) , m_waylandAuthenticationRequested(false)
@ -101,7 +101,7 @@ MousepadPlugin::~MousepadPlugin()
{ {
if (m_fakekey) { if (m_fakekey) {
free(m_fakekey); free(m_fakekey);
m_fakekey = 0; m_fakekey = nullptr;
} }
} }

View file

@ -48,8 +48,8 @@ public:
explicit MousepadPlugin(QObject *parent, const QVariantList &args); explicit MousepadPlugin(QObject *parent, const QVariantList &args);
virtual ~MousepadPlugin(); virtual ~MousepadPlugin();
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected() { } virtual void connected() override { }
private: private:
bool handlePackageX11(const NetworkPackage& np); bool handlePackageX11(const NetworkPackage& np);

View file

@ -41,8 +41,8 @@ public:
explicit MprisControlPlugin(QObject *parent, const QVariantList &args); explicit MprisControlPlugin(QObject *parent, const QVariantList &args);
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected() { } virtual void connected() override { }
private Q_SLOTS: private Q_SLOTS:
void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties); void propertiesChanged(const QString& propertyInterface, const QVariantMap& properties);

View file

@ -43,8 +43,8 @@ public:
virtual ~NotificationsPlugin(); virtual ~NotificationsPlugin();
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected(); virtual void connected() override;
private: private:
NotificationsDbusInterface* notificationsDbusInterface; NotificationsDbusInterface* notificationsDbusInterface;

View file

@ -36,9 +36,9 @@ public:
virtual ~PauseMusicConfig(); virtual ~PauseMusicConfig();
public Q_SLOTS: public Q_SLOTS:
virtual void save(); virtual void save() override;
virtual void load(); virtual void load() override;
virtual void defaults(); virtual void defaults() override;
private: private:
Ui::PauseMusicConfigUi* m_ui; Ui::PauseMusicConfigUi* m_ui;

View file

@ -36,8 +36,8 @@ public:
explicit PauseMusicPlugin(QObject *parent, const QVariantList &args); explicit PauseMusicPlugin(QObject *parent, const QVariantList &args);
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected() { } virtual void connected() override { }
/** /**
* @returns 0 if not muted, 1 if muted or -1 if there was an error * @returns 0 if not muted, 1 if muted or -1 if there was an error

View file

@ -41,8 +41,8 @@ public:
Q_SCRIPTABLE void sendPing(const QString& customMessage); Q_SCRIPTABLE void sendPing(const QString& customMessage);
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected(); virtual void connected() override;
private: private:
QString dbusPath() const; QString dbusPath() const;

View file

@ -46,7 +46,7 @@ ScreensaverInhibitPlugin::ScreensaverInhibitPlugin(QObject* parent, const QVaria
QDBusMessage reply = inhibitInterface.call(INHIBIT_METHOD, "kdeconnect", "Phone is connected"); 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(); qCDebug(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT) << "Unable to inhibit the screensaver: " << reply.errorMessage();
inhibitCookie = 0; inhibitCookie = 0;
} else { } else {

View file

@ -35,8 +35,8 @@ public:
virtual ~ScreensaverInhibitPlugin(); virtual ~ScreensaverInhibitPlugin();
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected(); virtual void connected() override;
private: private:
uint inhibitCookie; uint inhibitCookie;

View file

@ -32,7 +32,7 @@
Mounter::Mounter(SftpPlugin* sftp) Mounter::Mounter(SftpPlugin* sftp)
: QObject(sftp) : QObject(sftp)
, m_sftp(sftp) , m_sftp(sftp)
, m_proc(0) , m_proc(nullptr)
, m_mountPoint(sftp->mountPoint()) , m_mountPoint(sftp->mountPoint())
, m_started(false) , m_started(false)
{ {

View file

@ -41,7 +41,7 @@ static const QSet<QString> fields_c = QSet<QString>() << "ip" << "port" << "user
struct SftpPlugin::Pimpl struct SftpPlugin::Pimpl
{ {
Pimpl() : mounter(0) {} Pimpl() : mounter(nullptr) {}
//Add KIO entry to Dolphin's Places //Add KIO entry to Dolphin's Places
KFilePlacesModel placesModel; KFilePlacesModel placesModel;
@ -105,7 +105,7 @@ void SftpPlugin::unmount()
if (m_d->mounter) if (m_d->mounter)
{ {
m_d->mounter->deleteLater(); m_d->mounter->deleteLater();
m_d->mounter = 0; m_d->mounter = nullptr;
} }
} }
@ -124,7 +124,7 @@ bool SftpPlugin::startBrowsing()
{ {
if (mountAndWait()) { if (mountAndWait()) {
//return new KRun(QUrl::fromLocalFile(mountPoint()), 0); //return new KRun(QUrl::fromLocalFile(mountPoint()), 0);
return new KRun(QUrl("kdeconnect://"+deviceId), 0); return new KRun(QUrl("kdeconnect://"+deviceId), nullptr);
} }
return false; return false;
} }

View file

@ -44,8 +44,8 @@ Q_SIGNALS:
Q_SCRIPTABLE void unmounted(); Q_SCRIPTABLE void unmounted();
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected(); virtual void connected() override;
Q_SCRIPTABLE void mount(); Q_SCRIPTABLE void mount();
Q_SCRIPTABLE void unmount(); Q_SCRIPTABLE void unmount();

View file

@ -36,9 +36,9 @@ public:
virtual ~ShareConfig(); virtual ~ShareConfig();
public Q_SLOTS: public Q_SLOTS:
virtual void save(); virtual void save() override;
virtual void load(); virtual void load() override;
virtual void defaults(); virtual void defaults() override;
private: private:
Ui::ShareConfigUi* m_ui; Ui::ShareConfigUi* m_ui;

View file

@ -40,8 +40,8 @@ public:
///Helper method, QDBus won't recognize QUrl ///Helper method, QDBus won't recognize QUrl
Q_SCRIPTABLE void shareUrl(const QString& url) { shareUrl(QUrl(url)); } Q_SCRIPTABLE void shareUrl(const QString& url) { shareUrl(QUrl(url)); }
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected(); virtual void connected() override;
private Q_SLOTS: private Q_SLOTS:
void finished(KJob*); void finished(KJob*);

View file

@ -64,10 +64,10 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
content = i18n("SMS from %1<br>%2", phoneNumber, messageBody); content = i18n("SMS from %1<br>%2", phoneNumber, messageBody);
flags = KNotification::Persistent; flags = KNotification::Persistent;
} else if (event == "talking") { } else if (event == "talking") {
return NULL; return nullptr;
} else { } else {
#ifndef NDEBUG #ifndef NDEBUG
return NULL; return nullptr;
#else #else
type = QStringLiteral("callReceived"); type = QStringLiteral("callReceived");
icon = QStringLiteral("phone"); icon = QStringLiteral("phone");
@ -103,7 +103,7 @@ bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
} else { } else {
KNotification* n = createNotification(np); KNotification* n = createNotification(np);
if (n != NULL) n->sendEvent(); if (n != nullptr) n->sendEvent();
} }

View file

@ -40,8 +40,8 @@ public:
explicit TelephonyPlugin(QObject *parent, const QVariantList &args); explicit TelephonyPlugin(QObject *parent, const QVariantList &args);
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np) override;
virtual void connected() { } virtual void connected() override { }
void sendMutePackage(); void sendMutePackage();
private: private:

View file

@ -80,7 +80,7 @@ void TestSocketLineReader::socketLineReader()
QTcpSocket *sock = mServer->nextPendingConnection(); 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); mReader = new SocketLineReader(sock, this);
connect(mReader, SIGNAL(readyRead()), SLOT(newPackage())); connect(mReader, SIGNAL(readyRead()), SLOT(newPackage()));