diff options
| author | Juha Vuolle <juha.vuolle@qt.io> | 2024-02-12 11:18:55 +0200 |
|---|---|---|
| committer | Juha Vuolle <juha.vuolle@qt.io> | 2024-02-14 17:57:02 +0200 |
| commit | 6c213653d0841f00781e497a0cf724a145e75a0c (patch) | |
| tree | 0c248dc181e65d5751bdf03cba388c9076a82613 /src/network/access/qnetworkrequest.h | |
| parent | f21af7f88b2184a420293967d07bf6552541ddc9 (diff) | |
Inline old QNetworkRequest transferTimeout int overloads
Qt 6.7 introduced new std::chrono variants of the transfer
timeout functions. We can now inline the old 'int milliseconds'
functions to reduce the number of DLL entry points when one
isn't needed.
Task-number: QTBUG-122023
Change-Id: Iedcb6d0035bc6c3f03b87de543e9b02937b755e6
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/access/qnetworkrequest.h')
| -rw-r--r-- | src/network/access/qnetworkrequest.h | 17 |
1 files changed, 17 insertions, 0 deletions
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) |
