diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-25 18:41:14 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-30 10:57:50 +0000 |
commit | 65343eb28369823fd0c86384b488c3b7440d908a (patch) | |
tree | 5af5b7dad34eee5c15f605bace0f046805ba07c7 | |
parent | bc1804fa7247502b27a0501ec030e398a95bf367 (diff) |
QtNetwork: make all Q_DECLARE_SHARED types nothrow move-assignable
Change-Id: Ib29ec4b73a4cdc51074997f7d167c289cf5af7a4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r-- | src/network/access/qabstractnetworkcache.h | 5 | ||||
-rw-r--r-- | src/network/access/qhttpmultipart.h | 5 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.h | 5 | ||||
-rw-r--r-- | src/network/access/qnetworkrequest.h | 5 | ||||
-rw-r--r-- | src/network/bearer/qnetworkconfiguration.h | 5 | ||||
-rw-r--r-- | src/network/kernel/qdnslookup.h | 40 | ||||
-rw-r--r-- | src/network/kernel/qhostaddress.h | 7 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface.h | 10 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy.h | 14 | ||||
-rw-r--r-- | src/network/ssl/qsslcertificate.h | 5 | ||||
-rw-r--r-- | src/network/ssl/qsslcertificateextension.h | 8 | ||||
-rw-r--r-- | src/network/ssl/qsslcipher.h | 7 | ||||
-rw-r--r-- | src/network/ssl/qsslconfiguration.h | 5 | ||||
-rw-r--r-- | src/network/ssl/qsslerror.h | 5 | ||||
-rw-r--r-- | src/network/ssl/qsslkey.h | 7 | ||||
-rw-r--r-- | src/network/ssl/qsslpresharedkeyauthenticator.h | 8 |
16 files changed, 99 insertions, 42 deletions
diff --git a/src/network/access/qabstractnetworkcache.h b/src/network/access/qabstractnetworkcache.h index 352daa9700..73f05176d4 100644 --- a/src/network/access/qabstractnetworkcache.h +++ b/src/network/access/qabstractnetworkcache.h @@ -60,9 +60,12 @@ public: QNetworkCacheMetaData(const QNetworkCacheMetaData &other); ~QNetworkCacheMetaData(); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkCacheMetaData &operator=(QNetworkCacheMetaData &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkCacheMetaData &operator=(const QNetworkCacheMetaData &other); - void swap(QNetworkCacheMetaData &other) + void swap(QNetworkCacheMetaData &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QNetworkCacheMetaData &other) const; diff --git a/src/network/access/qhttpmultipart.h b/src/network/access/qhttpmultipart.h index 2e08a3d6f8..dd8b733426 100644 --- a/src/network/access/qhttpmultipart.h +++ b/src/network/access/qhttpmultipart.h @@ -51,9 +51,12 @@ public: QHttpPart(); QHttpPart(const QHttpPart &other); ~QHttpPart(); +#ifdef Q_COMPILER_RVALUE_REFS + QHttpPart &operator=(QHttpPart &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QHttpPart &operator=(const QHttpPart &other); - void swap(QHttpPart &other) { qSwap(d, other.d); } + void swap(QHttpPart &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QHttpPart &other) const; inline bool operator!=(const QHttpPart &other) const diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h index 2da86d3f81..27925c8201 100644 --- a/src/network/access/qnetworkcookie.h +++ b/src/network/access/qnetworkcookie.h @@ -59,9 +59,12 @@ public: explicit QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray()); QNetworkCookie(const QNetworkCookie &other); ~QNetworkCookie(); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkCookie &operator=(QNetworkCookie &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkCookie &operator=(const QNetworkCookie &other); - void swap(QNetworkCookie &other) { qSwap(d, other.d); } + void swap(QNetworkCookie &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QNetworkCookie &other) const; inline bool operator!=(const QNetworkCookie &other) const diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index c726db78cb..eb343c97df 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -106,9 +106,12 @@ public: explicit QNetworkRequest(const QUrl &url = QUrl()); QNetworkRequest(const QNetworkRequest &other); ~QNetworkRequest(); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkRequest &operator=(QNetworkRequest &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkRequest &operator=(const QNetworkRequest &other); - inline void swap(QNetworkRequest &other) { qSwap(d, other.d); } + void swap(QNetworkRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QNetworkRequest &other) const; inline bool operator!=(const QNetworkRequest &other) const diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h index dbef344e69..317c232bea 100644 --- a/src/network/bearer/qnetworkconfiguration.h +++ b/src/network/bearer/qnetworkconfiguration.h @@ -49,10 +49,13 @@ class Q_NETWORK_EXPORT QNetworkConfiguration public: QNetworkConfiguration(); QNetworkConfiguration(const QNetworkConfiguration& other); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkConfiguration &operator=(QNetworkConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkConfiguration &operator=(const QNetworkConfiguration &other); ~QNetworkConfiguration(); - void swap(QNetworkConfiguration &other) { qSwap(d, other.d); } + void swap(QNetworkConfiguration &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QNetworkConfiguration &other) const; inline bool operator!=(const QNetworkConfiguration &other) const diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h index 01ebbb6535..f13d268db7 100644 --- a/src/network/kernel/qdnslookup.h +++ b/src/network/kernel/qdnslookup.h @@ -55,16 +55,18 @@ class Q_NETWORK_EXPORT QDnsDomainNameRecord public: QDnsDomainNameRecord(); QDnsDomainNameRecord(const QDnsDomainNameRecord &other); +#ifdef Q_COMPILER_RVALUE_REFS + QDnsDomainNameRecord &operator=(QDnsDomainNameRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QDnsDomainNameRecord &operator=(const QDnsDomainNameRecord &other); ~QDnsDomainNameRecord(); - void swap(QDnsDomainNameRecord &other) { qSwap(d, other.d); } + void swap(QDnsDomainNameRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QString name() const; quint32 timeToLive() const; QString value() const; - QDnsDomainNameRecord &operator=(const QDnsDomainNameRecord &other); - private: QSharedDataPointer<QDnsDomainNameRecordPrivate> d; friend class QDnsLookupRunnable; @@ -77,16 +79,18 @@ class Q_NETWORK_EXPORT QDnsHostAddressRecord public: QDnsHostAddressRecord(); QDnsHostAddressRecord(const QDnsHostAddressRecord &other); +#ifdef Q_COMPILER_RVALUE_REFS + QDnsHostAddressRecord &operator=(QDnsHostAddressRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QDnsHostAddressRecord &operator=(const QDnsHostAddressRecord &other); ~QDnsHostAddressRecord(); - void swap(QDnsHostAddressRecord &other) { qSwap(d, other.d); } + void swap(QDnsHostAddressRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QString name() const; quint32 timeToLive() const; QHostAddress value() const; - QDnsHostAddressRecord &operator=(const QDnsHostAddressRecord &other); - private: QSharedDataPointer<QDnsHostAddressRecordPrivate> d; friend class QDnsLookupRunnable; @@ -99,17 +103,19 @@ class Q_NETWORK_EXPORT QDnsMailExchangeRecord public: QDnsMailExchangeRecord(); QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other); +#ifdef Q_COMPILER_RVALUE_REFS + QDnsMailExchangeRecord &operator=(QDnsMailExchangeRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QDnsMailExchangeRecord &operator=(const QDnsMailExchangeRecord &other); ~QDnsMailExchangeRecord(); - void swap(QDnsMailExchangeRecord &other) { qSwap(d, other.d); } + void swap(QDnsMailExchangeRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QString exchange() const; QString name() const; quint16 preference() const; quint32 timeToLive() const; - QDnsMailExchangeRecord &operator=(const QDnsMailExchangeRecord &other); - private: QSharedDataPointer<QDnsMailExchangeRecordPrivate> d; friend class QDnsLookupRunnable; @@ -122,9 +128,13 @@ class Q_NETWORK_EXPORT QDnsServiceRecord public: QDnsServiceRecord(); QDnsServiceRecord(const QDnsServiceRecord &other); +#ifdef Q_COMPILER_RVALUE_REFS + QDnsServiceRecord &operator=(QDnsServiceRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QDnsServiceRecord &operator=(const QDnsServiceRecord &other); ~QDnsServiceRecord(); - void swap(QDnsServiceRecord &other) { qSwap(d, other.d); } + void swap(QDnsServiceRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QString name() const; quint16 port() const; @@ -133,8 +143,6 @@ public: quint32 timeToLive() const; quint16 weight() const; - QDnsServiceRecord &operator=(const QDnsServiceRecord &other); - private: QSharedDataPointer<QDnsServiceRecordPrivate> d; friend class QDnsLookupRunnable; @@ -147,16 +155,18 @@ class Q_NETWORK_EXPORT QDnsTextRecord public: QDnsTextRecord(); QDnsTextRecord(const QDnsTextRecord &other); +#ifdef Q_COMPILER_RVALUE_REFS + QDnsTextRecord &operator=(QDnsTextRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QDnsTextRecord &operator=(const QDnsTextRecord &other); ~QDnsTextRecord(); - void swap(QDnsTextRecord &other) { qSwap(d, other.d); } + void swap(QDnsTextRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QString name() const; quint32 timeToLive() const; QList<QByteArray> values() const; - QDnsTextRecord &operator=(const QDnsTextRecord &other); - private: QSharedDataPointer<QDnsTextRecordPrivate> d; friend class QDnsLookupRunnable; diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index 0c2229c334..8478240d28 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -84,9 +84,16 @@ public: QHostAddress(SpecialAddress address); ~QHostAddress(); +#ifdef Q_COMPILER_RVALUE_REFS + QHostAddress &operator=(QHostAddress &&other) Q_DECL_NOTHROW + { swap(other); return *this; } +#endif + QHostAddress &operator=(const QHostAddress &other); QHostAddress &operator=(const QString &address); + void swap(QHostAddress &other) Q_DECL_NOTHROW { d.swap(other.d); } + void setAddress(quint32 ip4Addr); void setAddress(quint8 *ip6Addr); // ### Qt 6: remove me void setAddress(const quint8 *ip6Addr); diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index a4d93156fb..31d3b7b128 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -51,10 +51,13 @@ class Q_NETWORK_EXPORT QNetworkAddressEntry public: QNetworkAddressEntry(); QNetworkAddressEntry(const QNetworkAddressEntry &other); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkAddressEntry &operator=(QNetworkAddressEntry &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other); ~QNetworkAddressEntry(); - void swap(QNetworkAddressEntry &other) { qSwap(d, other.d); } + void swap(QNetworkAddressEntry &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QNetworkAddressEntry &other) const; inline bool operator!=(const QNetworkAddressEntry &other) const @@ -93,10 +96,13 @@ public: QNetworkInterface(); QNetworkInterface(const QNetworkInterface &other); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkInterface &operator=(QNetworkInterface &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkInterface &operator=(const QNetworkInterface &other); ~QNetworkInterface(); - void swap(QNetworkInterface &other) { qSwap(d, other.d); } + void swap(QNetworkInterface &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool isValid() const; diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h index 6b0f4a3937..717c141d60 100644 --- a/src/network/kernel/qnetworkproxy.h +++ b/src/network/kernel/qnetworkproxy.h @@ -63,7 +63,6 @@ public: QueryType queryType = TcpSocket); explicit QNetworkProxyQuery(quint16 bindPort, const QString &protocolTag = QString(), QueryType queryType = TcpServer); - QNetworkProxyQuery(const QNetworkProxyQuery &other); #ifndef QT_NO_BEARERMANAGEMENT QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration, const QUrl &requestUrl, QueryType queryType = UrlRequest); @@ -74,10 +73,14 @@ public: quint16 bindPort, const QString &protocolTag = QString(), QueryType queryType = TcpServer); #endif - ~QNetworkProxyQuery(); + QNetworkProxyQuery(const QNetworkProxyQuery &other); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkProxyQuery &operator=(const QNetworkProxyQuery &other); + ~QNetworkProxyQuery(); - void swap(QNetworkProxyQuery &other) { qSwap(d, other.d); } + void swap(QNetworkProxyQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QNetworkProxyQuery &other) const; inline bool operator!=(const QNetworkProxyQuery &other) const @@ -139,10 +142,13 @@ public: QNetworkProxy(ProxyType type, const QString &hostName = QString(), quint16 port = 0, const QString &user = QString(), const QString &password = QString()); QNetworkProxy(const QNetworkProxy &other); +#ifdef Q_COMPILER_RVALUE_REFS + QNetworkProxy &operator=(QNetworkProxy &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QNetworkProxy &operator=(const QNetworkProxy &other); ~QNetworkProxy(); - void swap(QNetworkProxy &other) { qSwap(d, other.d); } + void swap(QNetworkProxy &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QNetworkProxy &other) const; inline bool operator!=(const QNetworkProxy &other) const diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index ef0767ae8f..bd8dcb6c7f 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -83,9 +83,12 @@ public: explicit QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem); QSslCertificate(const QSslCertificate &other); ~QSslCertificate(); +#ifdef Q_COMPILER_RVALUE_REFS + QSslCertificate &operator=(QSslCertificate &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QSslCertificate &operator=(const QSslCertificate &other); - inline void swap(QSslCertificate &other) + void swap(QSslCertificate &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QSslCertificate &other) const; diff --git a/src/network/ssl/qsslcertificateextension.h b/src/network/ssl/qsslcertificateextension.h index 7c958eff30..8dd0e8eb4b 100644 --- a/src/network/ssl/qsslcertificateextension.h +++ b/src/network/ssl/qsslcertificateextension.h @@ -51,11 +51,13 @@ class Q_NETWORK_EXPORT QSslCertificateExtension public: QSslCertificateExtension(); QSslCertificateExtension(const QSslCertificateExtension &other); - ~QSslCertificateExtension(); - +#ifdef Q_COMPILER_RVALUE_REFS + QSslCertificateExtension &operator=(QSslCertificateExtension &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QSslCertificateExtension &operator=(const QSslCertificateExtension &other); + ~QSslCertificateExtension(); - void swap(QSslCertificateExtension &other) { qSwap(d, other.d); } + void swap(QSslCertificateExtension &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QString oid() const; QString name() const; diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h index dc65e32111..64122cdd53 100644 --- a/src/network/ssl/qsslcipher.h +++ b/src/network/ssl/qsslcipher.h @@ -52,10 +52,13 @@ public: explicit QSslCipher(const QString &name); QSslCipher(const QString &name, QSsl::SslProtocol protocol); QSslCipher(const QSslCipher &other); - ~QSslCipher(); +#ifdef Q_COMPILER_RVALUE_REFS + QSslCipher &operator=(QSslCipher &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QSslCipher &operator=(const QSslCipher &other); + ~QSslCipher(); - inline void swap(QSslCipher &other) + void swap(QSslCipher &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QSslCipher &other) const; diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index c5a1c6e6d4..8d7378f8ea 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -71,9 +71,12 @@ public: QSslConfiguration(); QSslConfiguration(const QSslConfiguration &other); ~QSslConfiguration(); +#ifdef Q_COMPILER_RVALUE_REFS + QSslConfiguration &operator=(QSslConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QSslConfiguration &operator=(const QSslConfiguration &other); - inline void swap(QSslConfiguration &other) + void swap(QSslConfiguration &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QSslConfiguration &other) const; diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h index b149f86d9e..bc2a2d5220 100644 --- a/src/network/ssl/qsslerror.h +++ b/src/network/ssl/qsslerror.h @@ -84,10 +84,13 @@ public: QSslError(const QSslError &other); - inline void swap(QSslError &other) + void swap(QSslError &other) Q_DECL_NOTHROW { qSwap(d, other.d); } ~QSslError(); +#ifdef Q_COMPILER_RVALUE_REFS + QSslError &operator=(QSslError &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QSslError &operator=(const QSslError &other); bool operator==(const QSslError &other) const; inline bool operator!=(const QSslError &other) const diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h index b89069e4cb..d02c031015 100644 --- a/src/network/ssl/qsslkey.h +++ b/src/network/ssl/qsslkey.h @@ -64,10 +64,13 @@ public: const QByteArray &passPhrase = QByteArray()); explicit QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey); QSslKey(const QSslKey &other); - ~QSslKey(); +#ifdef Q_COMPILER_RVALUE_REFS + QSslKey &operator=(QSslKey &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QSslKey &operator=(const QSslKey &other); + ~QSslKey(); - inline void swap(QSslKey &other) { qSwap(d, other.d); } + void swap(QSslKey &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool isNull() const; void clear(); diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h index 52301ef7e5..d5b9b34f28 100644 --- a/src/network/ssl/qsslpresharedkeyauthenticator.h +++ b/src/network/ssl/qsslpresharedkeyauthenticator.h @@ -52,14 +52,10 @@ public: QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator); #ifdef Q_COMPILER_RVALUE_REFS - inline QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&authenticator) - { d.swap(authenticator.d); return *this; } + QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif - void swap(QSslPreSharedKeyAuthenticator &authenticator) - { - d.swap(authenticator.d); - } + void swap(QSslPreSharedKeyAuthenticator &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QByteArray identityHint() const; |