From 8d7dcdfc5b2a231a1304878e25929e6f4ff4e338 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 30 Jun 2023 23:51:15 -0700 Subject: chore: fix shadowed member and signed/unsigned mismatch Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: supress unused with [[maybe_unused]] Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: unshadow ^&^& static_cast implicit return Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: deshadow and mark unused in parse task Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: mark unused in folder models Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: deshadow and mark unused with instances Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: more deshadow and unused Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: remove uneeded simicolons Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: mark unused Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> chore: prevent shadow Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- launcher/screenshots/ImgurUpload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/screenshots/ImgurUpload.cpp') diff --git a/launcher/screenshots/ImgurUpload.cpp b/launcher/screenshots/ImgurUpload.cpp index a50f9afa..4f758767 100644 --- a/launcher/screenshots/ImgurUpload.cpp +++ b/launcher/screenshots/ImgurUpload.cpp @@ -97,7 +97,7 @@ void ImgurUpload::executeTask() connect(rep, &QNetworkReply::sslErrors, this, &ImgurUpload::sslErrors); } -void ImgurUpload::downloadError(QNetworkReply::NetworkError error) +void ImgurUpload::downloadError([[maybe_unused]] QNetworkReply::NetworkError error) { qCritical() << "ImgurUpload failed with error" << m_reply->errorString() << "Server reply:\n" << m_reply->readAll(); if(finished) -- cgit From 91ba4cf75ee30c64779edb5b7644e5a830de5026 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Aug 2023 18:16:53 +0200 Subject: chore: reformat Signed-off-by: Sefa Eyeoglu --- launcher/screenshots/ImgurUpload.cpp | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'launcher/screenshots/ImgurUpload.cpp') diff --git a/launcher/screenshots/ImgurUpload.cpp b/launcher/screenshots/ImgurUpload.cpp index 4f758767..2d8c0db8 100644 --- a/launcher/screenshots/ImgurUpload.cpp +++ b/launcher/screenshots/ImgurUpload.cpp @@ -35,17 +35,17 @@ */ #include "ImgurUpload.h" -#include "BuildConfig.h" #include "Application.h" +#include "BuildConfig.h" -#include +#include +#include #include +#include #include #include -#include -#include +#include #include -#include ImgurUpload::ImgurUpload(ScreenShot::Ptr shot) : NetAction(), m_shot(shot) { @@ -63,13 +63,12 @@ void ImgurUpload::executeTask() request.setRawHeader("Accept", "application/json"); QFile f(m_shot->m_file.absoluteFilePath()); - if (!f.open(QFile::ReadOnly)) - { + if (!f.open(QFile::ReadOnly)) { emitFailed(); return; } - QHttpMultiPart *multipart = new QHttpMultiPart(QHttpMultiPart::FormDataType); + QHttpMultiPart* multipart = new QHttpMultiPart(QHttpMultiPart::FormDataType); QHttpPart filePart; filePart.setBody(f.readAll().toBase64()); filePart.setHeader(QNetworkRequest::ContentTypeHeader, "image/png"); @@ -84,12 +83,12 @@ void ImgurUpload::executeTask() namePart.setBody(m_shot->m_file.baseName().toUtf8()); multipart->append(namePart); - QNetworkReply *rep = m_network->post(request, multipart); + QNetworkReply* rep = m_network->post(request, multipart); m_reply.reset(rep); connect(rep, &QNetworkReply::uploadProgress, this, &ImgurUpload::downloadProgress); connect(rep, &QNetworkReply::finished, this, &ImgurUpload::downloadFinished); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) // QNetworkReply::errorOccurred added in 5.15 +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) // QNetworkReply::errorOccurred added in 5.15 connect(rep, &QNetworkReply::errorOccurred, this, &ImgurUpload::downloadError); #else connect(rep, QOverload::of(&QNetworkReply::error), this, &ImgurUpload::downloadError); @@ -100,8 +99,7 @@ void ImgurUpload::executeTask() void ImgurUpload::downloadError([[maybe_unused]] QNetworkReply::NetworkError error) { qCritical() << "ImgurUpload failed with error" << m_reply->errorString() << "Server reply:\n" << m_reply->readAll(); - if(finished) - { + if (finished) { qCritical() << "Double finished ImgurUpload!"; return; } @@ -113,8 +111,7 @@ void ImgurUpload::downloadError([[maybe_unused]] QNetworkReply::NetworkError err void ImgurUpload::downloadFinished() { - if(finished) - { + if (finished) { qCritical() << "Double finished ImgurUpload!"; return; } @@ -122,8 +119,7 @@ void ImgurUpload::downloadFinished() m_reply.reset(); QJsonParseError jsonError; QJsonDocument doc = QJsonDocument::fromJson(data, &jsonError); - if (jsonError.error != QJsonParseError::NoError) - { + if (jsonError.error != QJsonParseError::NoError) { qDebug() << "imgur server did not reply with JSON" << jsonError.errorString(); finished = true; m_reply.reset(); @@ -131,8 +127,7 @@ void ImgurUpload::downloadFinished() return; } auto object = doc.object(); - if (!object.value("success").toBool()) - { + if (!object.value("success").toBool()) { qDebug() << "Screenshot upload not successful:" << doc.toJson(); finished = true; m_reply.reset(); -- cgit From 215d7dbb741de9516ab5f00acb7b699adff82cab Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 4 Aug 2023 19:41:47 +0200 Subject: chore: update license headers Signed-off-by: Sefa Eyeoglu --- launcher/screenshots/ImgurUpload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/screenshots/ImgurUpload.cpp') diff --git a/launcher/screenshots/ImgurUpload.cpp b/launcher/screenshots/ImgurUpload.cpp index 2d8c0db8..29499a20 100644 --- a/launcher/screenshots/ImgurUpload.cpp +++ b/launcher/screenshots/ImgurUpload.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * PolyMC - Minecraft Launcher + * Prism Launcher - Minecraft Launcher * Copyright (c) 2022 flowln * Copyright (C) 2022 Sefa Eyeoglu * -- cgit