diff options
Diffstat (limited to 'src/network/kernel/qnetworkinterface.h')
-rw-r--r-- | src/network/kernel/qnetworkinterface.h | 54 |
1 files changed, 11 insertions, 43 deletions
diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index c65ea58860..2d79f9e2a1 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtNetwork module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QNETWORKINTERFACE_H #define QNETWORKINTERFACE_H @@ -45,6 +9,8 @@ #include <QtCore/qscopedpointer.h> #include <QtNetwork/qhostaddress.h> +#include <memory> + #ifndef QT_NO_NETWORKINTERFACE QT_BEGIN_NAMESPACE @@ -67,7 +33,7 @@ public: QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other); ~QNetworkAddressEntry(); - void swap(QNetworkAddressEntry &other) noexcept { qSwap(d, other.d); } + void swap(QNetworkAddressEntry &other) noexcept { d.swap(other.d); } bool operator==(const QNetworkAddressEntry &other) const; inline bool operator!=(const QNetworkAddressEntry &other) const @@ -96,7 +62,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) @@ -143,7 +110,7 @@ public: QNetworkInterface &operator=(const QNetworkInterface &other); ~QNetworkInterface(); - void swap(QNetworkInterface &other) noexcept { qSwap(d, other.d); } + void swap(QNetworkInterface &other) noexcept { d.swap(other.d); } bool isValid() const; @@ -173,13 +140,14 @@ Q_DECLARE_SHARED(QNetworkInterface) Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkInterface::InterfaceFlags) #ifndef QT_NO_DEBUG_STREAM +Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkAddressEntry &entry); Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface); #endif QT_END_NAMESPACE -Q_DECLARE_METATYPE(QNetworkAddressEntry) -Q_DECLARE_METATYPE(QNetworkInterface) +QT_DECL_METATYPE_EXTERN(QNetworkAddressEntry, Q_NETWORK_EXPORT) +QT_DECL_METATYPE_EXTERN(QNetworkInterface, Q_NETWORK_EXPORT) #endif // QT_NO_NETWORKINTERFACE |