From 1d468ac35ad88d8c77cc83f25e3704d9bd7df01b Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 2 Aug 2023 18:35:35 +0200 Subject: chore: reformat Signed-off-by: Sefa Eyeoglu --- launcher/screenshots/ImgurAlbumCreation.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'launcher/screenshots/ImgurAlbumCreation.cpp') diff --git a/launcher/screenshots/ImgurAlbumCreation.cpp b/launcher/screenshots/ImgurAlbumCreation.cpp index ab425f1a..68eb02ac 100644 --- a/launcher/screenshots/ImgurAlbumCreation.cpp +++ b/launcher/screenshots/ImgurAlbumCreation.cpp @@ -36,15 +36,15 @@ #include "ImgurAlbumCreation.h" -#include +#include #include #include -#include +#include #include -#include +#include -#include "BuildConfig.h" #include "Application.h" +#include "BuildConfig.h" ImgurAlbumCreation::ImgurAlbumCreation(QList screenshots) : NetAction(), m_screenshots(screenshots) { @@ -62,19 +62,18 @@ void ImgurAlbumCreation::executeTask() request.setRawHeader("Accept", "application/json"); QStringList hashes; - for (auto shot : m_screenshots) - { + for (auto shot : m_screenshots) { hashes.append(shot->m_imgurDeleteHash); } const QByteArray data = "deletehashes=" + hashes.join(',').toUtf8() + "&title=Minecraft%20Screenshots&privacy=hidden"; - QNetworkReply *rep = APPLICATION->network()->post(request, data); + QNetworkReply* rep = APPLICATION->network()->post(request, data); m_reply.reset(rep); connect(rep, &QNetworkReply::uploadProgress, this, &ImgurAlbumCreation::downloadProgress); connect(rep, &QNetworkReply::finished, this, &ImgurAlbumCreation::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, &ImgurAlbumCreation::downloadError); #else connect(rep, QOverload::of(&QNetworkReply::error), this, &ImgurAlbumCreation::downloadError); @@ -90,21 +89,18 @@ void ImgurAlbumCreation::downloadError(QNetworkReply::NetworkError error) void ImgurAlbumCreation::downloadFinished() { - if (m_state != State::Failed) - { + if (m_state != State::Failed) { QByteArray data = m_reply->readAll(); m_reply.reset(); QJsonParseError jsonError; QJsonDocument doc = QJsonDocument::fromJson(data, &jsonError); - if (jsonError.error != QJsonParseError::NoError) - { + if (jsonError.error != QJsonParseError::NoError) { qDebug() << jsonError.errorString(); emitFailed(); return; } auto object = doc.object(); - if (!object.value("success").toBool()) - { + if (!object.value("success").toBool()) { qDebug() << doc.toJson(); emitFailed(); return; @@ -114,9 +110,7 @@ void ImgurAlbumCreation::downloadFinished() m_state = State::Succeeded; emit succeeded(); return; - } - else - { + } else { qDebug() << m_reply->readAll(); m_reply.reset(); emitFailed(); -- cgit