From 2285e219e19bb916be7a53c81c2f918268829318 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 20 May 2021 15:21:15 +1000 Subject: [PATCH] Qt: Fix compiling auto updater with Qt 6 --- src/duckstation-qt/autoupdaterdialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/duckstation-qt/autoupdaterdialog.cpp b/src/duckstation-qt/autoupdaterdialog.cpp index 8318d7449..9a2ede929 100644 --- a/src/duckstation-qt/autoupdaterdialog.cpp +++ b/src/duckstation-qt/autoupdaterdialog.cpp @@ -116,7 +116,9 @@ void AutoUpdaterDialog::queueUpdateCheck(bool display_message) QUrl url(QUrl::fromEncoded(QByteArray(LATEST_TAG_URL))); QNetworkRequest request(url); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); +#endif m_network_access_mgr->get(request); #else emit updateCheckCompleted(); @@ -133,7 +135,9 @@ void AutoUpdaterDialog::queueGetLatestRelease() QUrl url(QUrl::fromEncoded(QByteArray(url_string))); QNetworkRequest request(url); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); +#endif m_network_access_mgr->get(request); #endif } @@ -266,7 +270,9 @@ void AutoUpdaterDialog::queueGetChanges() StringUtil::StdStringFromFormat(CHANGES_URL, g_scm_hash_str, getCurrentUpdateTag().c_str())); QUrl url(QUrl::fromEncoded(QByteArray(url_string.c_str(), static_cast(url_string.size())))); QNetworkRequest request(url); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); +#endif m_network_access_mgr->get(request); #endif }