From 6ee0da41c89419204421c2e8e3239173e24ec5ed Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 15 Jun 2021 11:45:29 +0200 Subject: [PATCH] [libcalamares] Avoid deprecation warning in network attributes --- src/libcalamares/network/Manager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/network/Manager.cpp b/src/libcalamares/network/Manager.cpp index d089551bb..79db1a587 100644 --- a/src/libcalamares/network/Manager.cpp +++ b/src/libcalamares/network/Manager.cpp @@ -27,10 +27,16 @@ namespace Network void RequestOptions::applyToRequest( QNetworkRequest* request ) const { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + constexpr const auto RedirectPolicyAttribute = QNetworkRequest::FollowRedirectsAttribute; +#else + constexpr const auto RedirectPolicyAttribute = QNetworkRequest::RedirectPolicyAttribute; +#endif + if ( m_flags & Flag::FollowRedirect ) { // Follows all redirects except unsafe ones (https to http). - request->setAttribute( QNetworkRequest::FollowRedirectsAttribute, true ); + request->setAttribute( RedirectPolicyAttribute, true ); } if ( m_flags & Flag::FakeUserAgent )