From 41e7b71c410b77a81d09d3cc2e169ffd7975b4d2 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Mar 2019 11:46:26 +0100 Subject: More nullptr usage in headers Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint Reviewed-by: Simon Hausmann --- src/dbus/qdbusintegrator_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dbus/qdbusintegrator_p.h') diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h index 3cd029a933..0f7e00fde0 100644 --- a/src/dbus/qdbusintegrator_p.h +++ b/src/dbus/qdbusintegrator_p.h @@ -106,7 +106,7 @@ class QDBusCallDeliveryEvent: public QMetaCallEvent public: QDBusCallDeliveryEvent(const QDBusConnection &c, int id, QObject *sender, const QDBusMessage &msg, const QVector &types, int f = 0) - : QMetaCallEvent(0, id, 0, sender, -1), connection(c), message(msg), metaTypes(types), flags(f) + : QMetaCallEvent(0, id, nullptr, sender, -1), connection(c), message(msg), metaTypes(types), flags(f) { } void placeMetaCall(QObject *object) override @@ -126,8 +126,8 @@ class QDBusActivateObjectEvent: public QMetaCallEvent public: QDBusActivateObjectEvent(const QDBusConnection &c, QObject *sender, const QDBusConnectionPrivate::ObjectTreeNode &n, - int p, const QDBusMessage &m, QSemaphore *s = 0) - : QMetaCallEvent(0, ushort(-1), 0, sender, -1, 0, 0, 0, s), connection(c), node(n), + int p, const QDBusMessage &m, QSemaphore *s = nullptr) + : QMetaCallEvent(0, ushort(-1), nullptr, sender, -1, 0, nullptr, nullptr, s), connection(c), node(n), pathStartPos(p), message(m), handled(false) { } ~QDBusActivateObjectEvent(); -- cgit v1.2.3 From 999c26dd83ad37fcd7a2b2fc62c0281f38c8e6e0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 1 Feb 2019 12:49:16 +0100 Subject: Add a QAbstractMetaCallEvent And use it to clean up the reimplementations in Qt DBus. Change-Id: I8e3fe35e8db6405cbcbfb45b42a8f2efecc1cef0 Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/dbus/qdbusintegrator_p.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/dbus/qdbusintegrator_p.h') diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h index 0f7e00fde0..44789b3317 100644 --- a/src/dbus/qdbusintegrator_p.h +++ b/src/dbus/qdbusintegrator_p.h @@ -101,36 +101,37 @@ struct QDBusSlotCache Q_DECLARE_SHARED(QDBusSlotCache::Data) Q_DECLARE_SHARED(QDBusSlotCache) -class QDBusCallDeliveryEvent: public QMetaCallEvent +class QDBusCallDeliveryEvent: public QAbstractMetaCallEvent { public: QDBusCallDeliveryEvent(const QDBusConnection &c, int id, QObject *sender, const QDBusMessage &msg, const QVector &types, int f = 0) - : QMetaCallEvent(0, id, nullptr, sender, -1), connection(c), message(msg), metaTypes(types), flags(f) + : QAbstractMetaCallEvent(sender, -1), connection(c), message(msg), metaTypes(types), id(id), flags(f) { } void placeMetaCall(QObject *object) override { - QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id()); + QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id); } private: QDBusConnection connection; // just for refcounting QDBusMessage message; QVector metaTypes; + int id; int flags; }; -class QDBusActivateObjectEvent: public QMetaCallEvent +class QDBusActivateObjectEvent: public QAbstractMetaCallEvent { public: QDBusActivateObjectEvent(const QDBusConnection &c, QObject *sender, const QDBusConnectionPrivate::ObjectTreeNode &n, int p, const QDBusMessage &m, QSemaphore *s = nullptr) - : QMetaCallEvent(0, ushort(-1), nullptr, sender, -1, 0, nullptr, nullptr, s), connection(c), node(n), + : QAbstractMetaCallEvent(sender, -1, s), connection(c), node(n), pathStartPos(p), message(m), handled(false) { } - ~QDBusActivateObjectEvent(); + ~QDBusActivateObjectEvent() override; void placeMetaCall(QObject *) override; @@ -142,15 +143,15 @@ private: bool handled; }; -class QDBusSpyCallEvent : public QMetaCallEvent +class QDBusSpyCallEvent : public QAbstractMetaCallEvent { public: typedef void (*Hook)(const QDBusMessage&); QDBusSpyCallEvent(QDBusConnectionPrivate *cp, const QDBusConnection &c, const QDBusMessage &msg, const Hook *hooks, int count) - : QMetaCallEvent(0, 0, nullptr, cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count) + : QAbstractMetaCallEvent(cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count) {} - ~QDBusSpyCallEvent(); + ~QDBusSpyCallEvent() override; void placeMetaCall(QObject *) override; static inline void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount); -- cgit v1.2.3 From 8d7c97d428cdf89c3419a4e13b62a9849feefce9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 4 Apr 2019 16:46:41 +0200 Subject: Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usage Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira --- src/dbus/qdbusintegrator_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dbus/qdbusintegrator_p.h') diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h index 0f7e00fde0..a6f7651c73 100644 --- a/src/dbus/qdbusintegrator_p.h +++ b/src/dbus/qdbusintegrator_p.h @@ -86,7 +86,7 @@ struct QDBusSlotCache int slotIdx; QVector metaTypes; - void swap(Data &other) Q_DECL_NOTHROW + void swap(Data &other) noexcept { qSwap(flags, other.flags); qSwap(slotIdx, other.slotIdx); @@ -96,7 +96,7 @@ struct QDBusSlotCache typedef QMultiHash Hash; Hash hash; - void swap(QDBusSlotCache &other) Q_DECL_NOTHROW { qSwap(hash, other.hash); } + void swap(QDBusSlotCache &other) noexcept { qSwap(hash, other.hash); } }; Q_DECLARE_SHARED(QDBusSlotCache::Data) Q_DECLARE_SHARED(QDBusSlotCache) -- cgit v1.2.3