From 792f762c155887aad81bb286b5052df0afc966fd Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 26 Jan 2026 21:07:34 -0600 Subject: [PATCH] Standardize on QString::toUtf8() --- app/backend/nvhttp.cpp | 2 +- app/backend/nvpairingmanager.cpp | 2 +- app/streaming/session.cpp | 8 ++++---- app/streaming/video/ffmpeg.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/backend/nvhttp.cpp b/app/backend/nvhttp.cpp index 1d7d706b..49cf6b96 100644 --- a/app/backend/nvhttp.cpp +++ b/app/backend/nvhttp.cpp @@ -389,7 +389,7 @@ NvHTTP::getXmlStringFromHex(QString xml, return nullptr; } - return QByteArray::fromHex(str.toLatin1()); + return QByteArray::fromHex(str.toUtf8()); } QString diff --git a/app/backend/nvpairingmanager.cpp b/app/backend/nvpairingmanager.cpp index e15f9780..16cc5a87 100644 --- a/app/backend/nvpairingmanager.cpp +++ b/app/backend/nvpairingmanager.cpp @@ -184,7 +184,7 @@ NvPairingManager::signMessage(const QByteArray& message) QByteArray NvPairingManager::saltPin(const QByteArray& salt, QString pin) { - return QByteArray().append(salt).append(pin.toLatin1()); + return QByteArray().append(salt).append(pin.toUtf8()); } NvPairingManager::PairState diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 52347fc8..a9dde174 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1633,8 +1633,8 @@ bool Session::startConnectionAsync() return false; } - QByteArray hostnameStr = m_Computer->activeAddress.address().toLatin1(); - QByteArray siAppVersion = m_Computer->appVersion.toLatin1(); + QByteArray hostnameStr = m_Computer->activeAddress.address().toUtf8(); + QByteArray siAppVersion = m_Computer->appVersion.toUtf8(); SERVER_INFORMATION hostInfo; hostInfo.address = hostnameStr.data(); @@ -1644,7 +1644,7 @@ bool Session::startConnectionAsync() // Older GFE versions didn't have this field QByteArray siGfeVersion; if (!m_Computer->gfeVersion.isEmpty()) { - siGfeVersion = m_Computer->gfeVersion.toLatin1(); + siGfeVersion = m_Computer->gfeVersion.toUtf8(); } if (!siGfeVersion.isEmpty()) { hostInfo.serverInfoGfeVersion = siGfeVersion.data(); @@ -1653,7 +1653,7 @@ bool Session::startConnectionAsync() // Older GFE and Sunshine versions didn't have this field QByteArray rtspSessionUrlStr; if (!rtspSessionUrl.isEmpty()) { - rtspSessionUrlStr = rtspSessionUrl.toLatin1(); + rtspSessionUrlStr = rtspSessionUrl.toUtf8(); hostInfo.rtspSessionUrl = rtspSessionUrlStr.data(); } diff --git a/app/streaming/video/ffmpeg.cpp b/app/streaming/video/ffmpeg.cpp index a6b64c96..4e4f843b 100644 --- a/app/streaming/video/ffmpeg.cpp +++ b/app/streaming/video/ffmpeg.cpp @@ -1635,7 +1635,7 @@ bool FFmpegVideoDecoder::initialize(PDECODER_PARAMETERS params) { QString h264DecoderHint = qgetenv("H264_DECODER_HINT"); if (!h264DecoderHint.isEmpty() && (params->videoFormat & VIDEO_FORMAT_MASK_H264)) { - QByteArray decoderString = h264DecoderHint.toLocal8Bit(); + QByteArray decoderString = h264DecoderHint.toUtf8(); if (tryInitializeRendererForUnknownDecoder(avcodec_find_decoder_by_name(decoderString.constData()), params, true)) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Using custom H.264 decoder (H264_DECODER_HINT): %s", @@ -1652,7 +1652,7 @@ bool FFmpegVideoDecoder::initialize(PDECODER_PARAMETERS params) { QString hevcDecoderHint = qgetenv("HEVC_DECODER_HINT"); if (!hevcDecoderHint.isEmpty() && (params->videoFormat & VIDEO_FORMAT_MASK_H265)) { - QByteArray decoderString = hevcDecoderHint.toLocal8Bit(); + QByteArray decoderString = hevcDecoderHint.toUtf8(); if (tryInitializeRendererForUnknownDecoder(avcodec_find_decoder_by_name(decoderString.constData()), params, true)) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Using custom HEVC decoder (HEVC_DECODER_HINT): %s", @@ -1669,7 +1669,7 @@ bool FFmpegVideoDecoder::initialize(PDECODER_PARAMETERS params) { QString av1DecoderHint = qgetenv("AV1_DECODER_HINT"); if (!av1DecoderHint.isEmpty() && (params->videoFormat & VIDEO_FORMAT_MASK_AV1)) { - QByteArray decoderString = av1DecoderHint.toLocal8Bit(); + QByteArray decoderString = av1DecoderHint.toUtf8(); if (tryInitializeRendererForUnknownDecoder(avcodec_find_decoder_by_name(decoderString.constData()), params, true)) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Using custom AV1 decoder (AV1_DECODER_HINT): %s",