mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
@@ -1,5 +1,4 @@
|
|||||||
#include "autoupdatechecker.h"
|
#include "autoupdatechecker.h"
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
@@ -62,7 +61,7 @@ void AutoUpdateChecker::handleUpdateCheckRequestFinished(QNetworkReply* reply)
|
|||||||
{
|
{
|
||||||
Q_ASSERT(reply->isFinished());
|
Q_ASSERT(reply->isFinished());
|
||||||
|
|
||||||
if (QNETREPLY_GET_ERROR(reply) == QNetworkReply::NoError) {
|
if (reply->error() == QNetworkReply::NoError) {
|
||||||
QTextStream stream(reply);
|
QTextStream stream(reply);
|
||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
|
|
||||||
@@ -155,7 +154,7 @@ void AutoUpdateChecker::handleUpdateCheckRequestFinished(QNetworkReply* reply)
|
|||||||
<< QSysInfo::buildCpuArchitecture() << getPlatform();
|
<< QSysInfo::buildCpuArchitecture() << getPlatform();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qWarning() << "Update checking failed with error: " << QNETREPLY_GET_ERROR(reply);
|
qWarning() << "Update checking failed with error: " << reply->error();
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "nvcomputer.h"
|
#include "nvcomputer.h"
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
#include <QUdpSocket>
|
#include <QUdpSocket>
|
||||||
#include <QHostInfo>
|
#include <QHostInfo>
|
||||||
@@ -230,7 +229,7 @@ bool NvComputer::wake()
|
|||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qWarning() << "Send failed:" << QSOCK_GET_ERROR(&sock);
|
qWarning() << "Send failed:" << sock.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "nvhttp.h"
|
#include "nvhttp.h"
|
||||||
#include "utils.h"
|
|
||||||
#include <Limelight.h>
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -489,26 +488,26 @@ NvHTTP::openConnection(QUrl baseUrl,
|
|||||||
m_Nam.clearAccessCache();
|
m_Nam.clearAccessCache();
|
||||||
|
|
||||||
// Handle error
|
// Handle error
|
||||||
if (QNETREPLY_GET_ERROR(reply) != QNetworkReply::NoError)
|
if (reply->error() != QNetworkReply::NoError)
|
||||||
{
|
{
|
||||||
if (logLevel >= NvLogLevel::NVLL_ERROR) {
|
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
|
// This will trigger falling back to HTTP for the serverinfo query
|
||||||
// then pairing again to get the updated certificate.
|
// then pairing again to get the updated certificate.
|
||||||
GfeHttpResponseException exception(401, "Server certificate mismatch");
|
GfeHttpResponseException exception(401, "Server certificate mismatch");
|
||||||
delete reply;
|
delete reply;
|
||||||
throw exception;
|
throw exception;
|
||||||
}
|
}
|
||||||
else if (QNETREPLY_GET_ERROR(reply) == QNetworkReply::OperationCanceledError) {
|
else if (reply->error() == QNetworkReply::OperationCanceledError) {
|
||||||
QtNetworkReplyException exception(QNetworkReply::TimeoutError, "Request timed out");
|
QtNetworkReplyException exception(QNetworkReply::TimeoutError, "Request timed out");
|
||||||
delete reply;
|
delete reply;
|
||||||
throw exception;
|
throw exception;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QtNetworkReplyException exception(QNETREPLY_GET_ERROR(reply), reply->errorString());
|
QtNetworkReplyException exception(reply->error(), reply->errorString());
|
||||||
delete reply;
|
delete reply;
|
||||||
throw exception;
|
throw exception;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,13 @@ MappingManager::MappingManager()
|
|||||||
settings.endArray();
|
settings.endArray();
|
||||||
|
|
||||||
// Finally load mappings from SDL_HINT_GAMECONTROLLERCONFIG
|
// 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) {
|
for (QString sdlMapping : sdlMappings) {
|
||||||
SdlGamepadMapping mapping(sdlMapping);
|
SdlGamepadMapping mapping(sdlMapping);
|
||||||
addMapping(mapping);
|
addMapping(mapping);
|
||||||
|
|||||||
-10
@@ -1,18 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtGlobal>
|
|
||||||
|
|
||||||
#define THROW_BAD_ALLOC_IF_NULL(x) \
|
#define THROW_BAD_ALLOC_IF_NULL(x) \
|
||||||
if ((x) == nullptr) throw std::bad_alloc()
|
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 {
|
namespace WMUtils {
|
||||||
bool isRunningX11();
|
bool isRunningX11();
|
||||||
bool isRunningWayland();
|
bool isRunningWayland();
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#ifdef HAS_X11
|
#ifdef HAS_X11
|
||||||
|
|||||||
Reference in New Issue
Block a user