diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2022-03-24 09:19:58 +0100 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2022-03-24 09:18:22 +0000 |
commit | 87a974259d1b0289e85c61e0b45251d6261e4f0f (patch) | |
tree | f1b1b550f7ff91aa863505de299e27d335ccaace /src | |
parent | fa0da0f583b9d18e0eb57ec197f454ce0f0ae0d5 (diff) |
Fix QScopedPointer::swap deprecation warning
By switching to unique_ptr.
Also remove the QSerialPortInfoPrivateDeleter since it's not needed.
Fixes: QTBUG-102001
Change-Id: I48d7b5982a28b57085883f127ba09d1cae94b196
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/serialport/qserialportinfo.cpp | 6 | ||||
-rw-r--r-- | src/serialport/qserialportinfo.h | 3 | ||||
-rw-r--r-- | src/serialport/qserialportinfo_p.h | 8 |
3 files changed, 7 insertions, 10 deletions
diff --git a/src/serialport/qserialportinfo.cpp b/src/serialport/qserialportinfo.cpp index d823eac7..f27368d7 100644 --- a/src/serialport/qserialportinfo.cpp +++ b/src/serialport/qserialportinfo.cpp @@ -46,6 +46,12 @@ QT_BEGIN_NAMESPACE +// We changed from QScopedPointer to std::unique_ptr, make sure it's +// binary compatible. The QScopedPointer had a non-default deleter, but +// the deleter just provides a static function to use for deletion so we don't +// include it in this template definition (the deleter-class was deleted). +static_assert(sizeof(std::unique_ptr<QSerialPortInfoPrivate>) + == sizeof(QScopedPointer<QSerialPortInfoPrivate>)); /*! \class QSerialPortInfo diff --git a/src/serialport/qserialportinfo.h b/src/serialport/qserialportinfo.h index 9ef8c22d..8b927509 100644 --- a/src/serialport/qserialportinfo.h +++ b/src/serialport/qserialportinfo.h @@ -50,7 +50,6 @@ QT_BEGIN_NAMESPACE class QSerialPort; class QSerialPortInfoPrivate; -class QSerialPortInfoPrivateDeleter; class Q_SERIALPORT_EXPORT QSerialPortInfo { @@ -87,7 +86,7 @@ private: friend QList<QSerialPortInfo> availablePortsByUdev(bool &ok); friend QList<QSerialPortInfo> availablePortsBySysfs(bool &ok); friend QList<QSerialPortInfo> availablePortsByFiltersOfDevices(bool &ok); - QScopedPointer<QSerialPortInfoPrivate, QSerialPortInfoPrivateDeleter> d_ptr; + std::unique_ptr<QSerialPortInfoPrivate> d_ptr; }; inline bool QSerialPortInfo::isNull() const diff --git a/src/serialport/qserialportinfo_p.h b/src/serialport/qserialportinfo_p.h index 3a9c5a07..9df9bc48 100644 --- a/src/serialport/qserialportinfo_p.h +++ b/src/serialport/qserialportinfo_p.h @@ -77,14 +77,6 @@ public: bool hasProductIdentifier = false; }; -class QSerialPortInfoPrivateDeleter -{ -public: - static void cleanup(QSerialPortInfoPrivate *p) { - delete p; - } -}; - QT_END_NAMESPACE #endif // QSERIALPORTINFO_P_H |