summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qnetworkinterface.cpp7
-rw-r--r--src/network/kernel/qnetworkinterface.h5
2 files changed, 9 insertions, 3 deletions
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 6e87a783a8..b8ba9fcd07 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -49,6 +49,9 @@
QT_BEGIN_NAMESPACE
+static_assert(QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
+ && sizeof(QScopedPointer<QNetworkAddressEntryPrivate>) == sizeof(std::unique_ptr<QNetworkAddressEntryPrivate>));
+
static QList<QNetworkInterfacePrivate *> postProcess(QList<QNetworkInterfacePrivate *> list)
{
// Some platforms report a netmask but don't report a broadcast address
@@ -204,7 +207,7 @@ QNetworkAddressEntry::QNetworkAddressEntry()
object \a other.
*/
QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other)
- : d(new QNetworkAddressEntryPrivate(*other.d.data()))
+ : d(new QNetworkAddressEntryPrivate(*other.d.get()))
{
}
@@ -213,7 +216,7 @@ QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other)
*/
QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry &other)
{
- *d.data() = *other.d.data();
+ *d.get() = *other.d.get();
return *this;
}
diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h
index c65ea58860..b96ca0e5fa 100644
--- a/src/network/kernel/qnetworkinterface.h
+++ b/src/network/kernel/qnetworkinterface.h
@@ -45,6 +45,8 @@
#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qhostaddress.h>
+#include <memory>
+
#ifndef QT_NO_NETWORKINTERFACE
QT_BEGIN_NAMESPACE
@@ -96,7 +98,8 @@ public:
bool isTemporary() const { return !isPermanent(); }
private:
- QScopedPointer<QNetworkAddressEntryPrivate> d;
+ // ### Qt 7: make implicitly shared
+ std::unique_ptr<QNetworkAddressEntryPrivate> d;
};
Q_DECLARE_SHARED(QNetworkAddressEntry)