Fix build on Qt 5.15 Beta 2

Reverts most of 10dae7482c
This commit is contained in:
Cameron Gutman 2020-03-23 18:30:56 -07:00
commit 6c980eba68
6 changed files with 17 additions and 22 deletions

View file

@ -1,5 +1,4 @@
#include "autoupdatechecker.h"
#include "utils.h"
#include <QNetworkReply>
#include <QJsonDocument>
@ -62,7 +61,7 @@ void AutoUpdateChecker::handleUpdateCheckRequestFinished(QNetworkReply* reply)
{
Q_ASSERT(reply->isFinished());
if (QNETREPLY_GET_ERROR(reply) == QNetworkReply::NoError) {
if (reply->error() == QNetworkReply::NoError) {
QTextStream stream(reply);
stream.setCodec("UTF-8");
@ -155,7 +154,7 @@ void AutoUpdateChecker::handleUpdateCheckRequestFinished(QNetworkReply* reply)
<< QSysInfo::buildCpuArchitecture() << getPlatform();
}
else {
qWarning() << "Update checking failed with error: " << QNETREPLY_GET_ERROR(reply);
qWarning() << "Update checking failed with error: " << reply->error();
reply->deleteLater();
}
}

View file

@ -1,5 +1,4 @@
#include "nvcomputer.h"
#include "utils.h"
#include <QUdpSocket>
#include <QHostInfo>
@ -230,7 +229,7 @@ bool NvComputer::wake()
success = true;
}
else {
qWarning() << "Send failed:" << QSOCK_GET_ERROR(&sock);
qWarning() << "Send failed:" << sock.error();
}
}
}

View file

@ -1,5 +1,4 @@
#include "nvhttp.h"
#include "utils.h"
#include <Limelight.h>
#include <QDebug>
@ -489,26 +488,26 @@ NvHTTP::openConnection(QUrl baseUrl,
m_Nam.clearAccessCache();
// Handle error
if (QNETREPLY_GET_ERROR(reply) != QNetworkReply::NoError)
if (reply->error() != QNetworkReply::NoError)
{
if (logLevel >= NvLogLevel::NVLL_ERROR) {
qWarning() << command << " request failed with error " << QNETREPLY_GET_ERROR(reply);
qWarning() << command << " request failed with error " << reply->error();
}
if (QNETREPLY_GET_ERROR(reply) == QNetworkReply::SslHandshakeFailedError) {
if (reply->error() == QNetworkReply::SslHandshakeFailedError) {
// This will trigger falling back to HTTP for the serverinfo query
// then pairing again to get the updated certificate.
GfeHttpResponseException exception(401, "Server certificate mismatch");
delete reply;
throw exception;
}
else if (QNETREPLY_GET_ERROR(reply) == QNetworkReply::OperationCanceledError) {
else if (reply->error() == QNetworkReply::OperationCanceledError) {
QtNetworkReplyException exception(QNetworkReply::TimeoutError, "Request timed out");
delete reply;
throw exception;
}
else {
QtNetworkReplyException exception(QNETREPLY_GET_ERROR(reply), reply->errorString());
QtNetworkReplyException exception(reply->error(), reply->errorString());
delete reply;
throw exception;
}

View file

@ -26,7 +26,13 @@ MappingManager::MappingManager()
settings.endArray();
// Finally load mappings from SDL_HINT_GAMECONTROLLERCONFIG
QStringList sdlMappings = QString::fromLocal8Bit(SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG)).split('\n', QString::SkipEmptyParts);
QStringList sdlMappings =
QString::fromLocal8Bit(SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG))
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
.split('\n', Qt::SkipEmptyParts);
#else
.split('\n', QString::SkipEmptyParts);
#endif
for (QString sdlMapping : sdlMappings) {
SdlGamepadMapping mapping(sdlMapping);
addMapping(mapping);

View file

@ -1,18 +1,8 @@
#pragma once
#include <QtGlobal>
#define THROW_BAD_ALLOC_IF_NULL(x) \
if ((x) == nullptr) throw std::bad_alloc()
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#define QNETREPLY_GET_ERROR(r) ((r)->networkError())
#define QSOCK_GET_ERROR(s) ((s)->socketError())
#else
#define QNETREPLY_GET_ERROR(r) ((r)->error())
#define QSOCK_GET_ERROR(s) ((s)->error())
#endif
namespace WMUtils {
bool isRunningX11();
bool isRunningWayland();

View file

@ -1,3 +1,5 @@
#include <QtGlobal>
#include "utils.h"
#ifdef HAS_X11