diff options
-rw-r--r-- | src/network/access/qnetworkrequest.cpp | 10 | ||||
-rw-r--r-- | src/network/access/qnetworkrequest.h | 17 | ||||
-rw-r--r-- | src/network/compat/removed_api.cpp | 10 |
3 files changed, 29 insertions, 8 deletions
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index e084d08e8bf..6f5a7ff19ad 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -985,18 +985,16 @@ void QNetworkRequest::setDecompressedSafetyCheckThreshold(qint64 threshold) #if QT_CONFIG(http) || defined (Q_OS_WASM) /*! + \fn int QNetworkRequest::transferTimeout() const \since 5.15 Returns the timeout used for transfers, in milliseconds. \sa setTransferTimeout() */ -int QNetworkRequest::transferTimeout() const -{ - return int(d->transferTimeout.count()); -} /*! + \fn void QNetworkRequest::setTransferTimeout(int timeout) \since 5.15 Sets \a timeout as the transfer timeout in milliseconds. @@ -1004,10 +1002,6 @@ int QNetworkRequest::transferTimeout() const \sa setTransferTimeout(std::chrono::milliseconds), transferTimeout(), transferTimeoutAsDuration() */ -void QNetworkRequest::setTransferTimeout(int timeout) -{ - d->transferTimeout = std::chrono::milliseconds(timeout); -} /*! \since 6.7 diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index 75458e156be..3ca61a2ee34 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -168,8 +168,11 @@ public: #endif // QT_CONFIG(http) #if QT_CONFIG(http) || defined (Q_OS_WASM) + QT_NETWORK_INLINE_SINCE(6, 8) int transferTimeout() const; + QT_NETWORK_INLINE_SINCE(6, 8) void setTransferTimeout(int timeout); + std::chrono::milliseconds transferTimeoutAsDuration() const; void setTransferTimeout(std::chrono::milliseconds duration = DefaultTransferTimeout); #endif // QT_CONFIG(http) || defined (Q_OS_WASM) @@ -180,6 +183,20 @@ private: Q_DECLARE_SHARED(QNetworkRequest) +#if QT_NETWORK_INLINE_IMPL_SINCE(6, 8) +#if QT_CONFIG(http) || defined (Q_OS_WASM) +int QNetworkRequest::transferTimeout() const +{ + return int(transferTimeoutAsDuration().count()); +} + +void QNetworkRequest::setTransferTimeout(int timeout) +{ + setTransferTimeout(std::chrono::milliseconds(timeout)); +} +#endif // QT_CONFIG(http) || defined (Q_OS_WASM) +#endif // INLINE_SINCE 6.8 + QT_END_NAMESPACE QT_DECL_METATYPE_EXTERN(QNetworkRequest, Q_NETWORK_EXPORT) diff --git a/src/network/compat/removed_api.cpp b/src/network/compat/removed_api.cpp index 956018cece0..86951d92226 100644 --- a/src/network/compat/removed_api.cpp +++ b/src/network/compat/removed_api.cpp @@ -55,3 +55,13 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin // order sections alphabetically #endif // QT_NETWORK_REMOVED_SINCE(6, 7) + +#if QT_NETWORK_REMOVED_SINCE(6, 8) + +#include "qnetworkrequest.h" // inlined API + +// #include "qotherheader.h" +// // implement removed functions from qotherheader.h +// order sections alphabetically + +#endif // QT_NETWORK_REMOVED_SINCE(6, 8) |