mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Fix build on Qt 5.14 and earlier
This commit is contained in:
@@ -40,7 +40,11 @@ void AutoUpdateChecker::start()
|
|||||||
// We'll get a callback when this is finished
|
// We'll get a callback when this is finished
|
||||||
QUrl url("https://moonlight-stream.org/updates/qt.json");
|
QUrl url("https://moonlight-stream.org/updates/qt.json");
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||||
request.setAttribute(QNetworkRequest::Http2AllowedAttribute, true);
|
request.setAttribute(QNetworkRequest::Http2AllowedAttribute, true);
|
||||||
|
#else
|
||||||
|
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
|
||||||
|
#endif
|
||||||
m_Nam.get(request);
|
m_Nam.get(request);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,18 @@ void MappingFetcher::start()
|
|||||||
|
|
||||||
QUrl url("https://moonlight-stream.org/SDL_GameControllerDB/gamecontrollerdb.txt");
|
QUrl url("https://moonlight-stream.org/SDL_GameControllerDB/gamecontrollerdb.txt");
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
request.setAttribute(QNetworkRequest::Http2AllowedAttribute, true);
|
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
request.setAttribute(QNetworkRequest::Http2AllowedAttribute, true);
|
||||||
|
#else
|
||||||
|
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Qt 5.12 introduced QNetworkRequest::IfModifiedSinceHeader. We _could_ implement it
|
||||||
|
// by hand (including QDateTime conversion to the correct string form) for earlier Qt
|
||||||
|
// versions, but that's a pain and this is just an optimization anyway. We'll do a bit
|
||||||
|
// of extra work on those legacy Qt versions by fetching the GCDB each time we launch.
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
||||||
// Only download the file if it's newer than what we have
|
// Only download the file if it's newer than what we have
|
||||||
QFileInfo existingFileInfo = Path::getCacheFileInfo("gamecontrollerdb.txt");
|
QFileInfo existingFileInfo = Path::getCacheFileInfo("gamecontrollerdb.txt");
|
||||||
if (existingFileInfo.exists()) {
|
if (existingFileInfo.exists()) {
|
||||||
@@ -41,6 +51,7 @@ void MappingFetcher::start()
|
|||||||
Path::deleteCacheFile("gamecontrollerdb.txt");
|
Path::deleteCacheFile("gamecontrollerdb.txt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// We'll get a callback when this is finished
|
// We'll get a callback when this is finished
|
||||||
m_Nam.get(request);
|
m_Nam.get(request);
|
||||||
|
|||||||
Reference in New Issue
Block a user