From 0ab44505c88c881499a245e27c198fa6c2fb70de Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 7 Jan 2025 13:04:42 +0100 Subject: [PATCH] QDBusPendingReplyBase: add missing copy operations QDBusPendingReplyBase declares its destructor (and defines it, as defaulted, out-of-line). I'm not sure why that's the case, since QDBusPendingReplyBase isn't polymorphic. This generates warnings when QDBusPendingReplyBase objects are copied in the subclasses, since the copy operations are deprecated due to the presence of the destructor. Add the missing copy operations, and mark destructor and copies to be removed in Qt 7. Change-Id: Iec2c98f5e512c3f19e5d28ab2ce2dba365c66175 Reviewed-by: Thiago Macieira --- src/dbus/qdbuspendingreply.cpp | 2 ++ src/dbus/qdbuspendingreply.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/dbus/qdbuspendingreply.cpp b/src/dbus/qdbuspendingreply.cpp index fef68579d33..7bb23aa3e36 100644 --- a/src/dbus/qdbuspendingreply.cpp +++ b/src/dbus/qdbuspendingreply.cpp @@ -213,9 +213,11 @@ QDBusPendingReplyBase::QDBusPendingReplyBase() { } +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) QDBusPendingReplyBase::~QDBusPendingReplyBase() { } +#endif void QDBusPendingReplyBase::assign(const QDBusPendingCall &other) { diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index 580b967b3bd..72e1bbdc313 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -17,7 +17,12 @@ class Q_DBUS_EXPORT QDBusPendingReplyBase : public QDBusPendingCall { protected: QDBusPendingReplyBase(); +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) ~QDBusPendingReplyBase(); + QDBusPendingReplyBase(const QDBusPendingReplyBase &) = default; + QDBusPendingReplyBase &operator=(const QDBusPendingReplyBase &) = default; +#endif + void assign(const QDBusPendingCall &call); void assign(const QDBusMessage &message);