mirror of https://github.com/mgba-emu/mgba.git
Qt: Attempt to fix 5.8 build
This commit is contained in:
parent
e9ec009836
commit
b220c7a68b
|
@ -180,6 +180,9 @@ void ForwarderController::downloadBuild(const QUrl& url) {
|
|||
|
||||
connectReply(reply, BASE, &ForwarderController::gotBuild);
|
||||
connect(reply, &QNetworkReply::readyRead, this, [this, reply]() {
|
||||
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() / 100 != 2) {
|
||||
return;
|
||||
}
|
||||
QByteArray data = reply->readAll();
|
||||
m_sourceFile.write(data);
|
||||
});
|
||||
|
@ -236,8 +239,13 @@ void ForwarderController::connectReply(QNetworkReply* reply, Download download,
|
|||
emit buildFailed();
|
||||
});
|
||||
|
||||
connect(reply, &QNetworkReply::finished, this, [this, reply, next]() {
|
||||
connect(reply, &QNetworkReply::finished, this, [this, reply, download, next]() {
|
||||
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() / 100 == 3) {
|
||||
QNetworkReply* newReply = GBAApp::app()->httpGet(reply->header(QNetworkRequest::LocationHeader).toString());
|
||||
connectReply(newReply, download, next);
|
||||
} else {
|
||||
(this->*next)(reply);
|
||||
}
|
||||
});
|
||||
connect(reply, &QNetworkReply::downloadProgress, this, [this, download](qint64 bytesReceived, qint64 bytesTotal) {
|
||||
emit downloadProgress(download, bytesReceived, bytesTotal);
|
||||
|
|
|
@ -82,7 +82,9 @@ GBAApp::GBAApp(int& argc, char* argv[], ConfigController* config)
|
|||
m_configController->updateOption("useDiscordPresence");
|
||||
#endif
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
|
||||
m_netman.setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||
#endif
|
||||
|
||||
cleanupAfterUpdate();
|
||||
|
||||
|
|
Loading…
Reference in New Issue