From 2804099f16a15f6098d26c5d62749d2d1aab9ea2 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 4 Aug 2020 13:28:09 +0200 Subject: Cleanup around [BaseJob::]IncorrectResponse[Error] --- lib/jobs/basejob.cpp | 5 ++--- lib/jobs/mediathumbnailjob.cpp | 3 +-- lib/jobs/syncjob.cpp | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'lib/jobs') diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp index 465287c6..d6d48d2f 100644 --- a/lib/jobs/basejob.cpp +++ b/lib/jobs/basejob.cpp @@ -401,9 +401,8 @@ BaseJob::Status BaseJob::Private::parseJson() { QJsonParseError error { 0, QJsonParseError::MissingObject }; jsonResponse = QJsonDocument::fromJson(rawResponse, &error); - return { error.error == QJsonParseError::NoError - ? BaseJob::NoError - : BaseJob::IncorrectResponse, + return { error.error == QJsonParseError::NoError ? NoError + : IncorrectResponse, error.errorString() }; } diff --git a/lib/jobs/mediathumbnailjob.cpp b/lib/jobs/mediathumbnailjob.cpp index 33f4236c..a69f00e9 100644 --- a/lib/jobs/mediathumbnailjob.cpp +++ b/lib/jobs/mediathumbnailjob.cpp @@ -53,6 +53,5 @@ BaseJob::Status MediaThumbnailJob::prepareResult() if (_thumbnail.loadFromData(data()->readAll())) return Success; - return { IncorrectResponseError, - QStringLiteral("Could not read image data") }; + return { IncorrectResponse, QStringLiteral("Could not read image data") }; } diff --git a/lib/jobs/syncjob.cpp b/lib/jobs/syncjob.cpp index 6b8cfe4b..9087fe50 100644 --- a/lib/jobs/syncjob.cpp +++ b/lib/jobs/syncjob.cpp @@ -53,9 +53,9 @@ BaseJob::Status SyncJob::prepareResult() { d.parseJson(jsonData()); if (d.unresolvedRooms().isEmpty()) - return BaseJob::Success; + return Success; qCCritical(MAIN).noquote() << "Incomplete sync response, missing rooms:" << d.unresolvedRooms().join(','); - return BaseJob::IncorrectResponseError; + return IncorrectResponse; } -- cgit v1.2.3