aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-08-04 13:28:09 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-08-04 13:51:39 +0200
commit2804099f16a15f6098d26c5d62749d2d1aab9ea2 (patch)
treef17b579c4cafc3735aae9779d8438adff1888d9b /lib
parent640cfee652721a1683a0f87d409d0b85bfada211 (diff)
downloadlibquotient-2804099f16a15f6098d26c5d62749d2d1aab9ea2.tar.gz
libquotient-2804099f16a15f6098d26c5d62749d2d1aab9ea2.zip
Cleanup around [BaseJob::]IncorrectResponse[Error]
Diffstat (limited to 'lib')
-rw-r--r--lib/jobs/basejob.cpp5
-rw-r--r--lib/jobs/mediathumbnailjob.cpp3
-rw-r--r--lib/jobs/syncjob.cpp4
3 files changed, 5 insertions, 7 deletions
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;
}