aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-06-07 19:23:55 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-06-07 19:28:55 +0900
commite8718d8b1d61d6f70e61da0436f793a461e83bd7 (patch)
tree7cd1f6798792cedd69e7bba01850a47b55eae62c
parent7ea51059b86d8124c077ed84ad3b91770af8d610 (diff)
downloadlibquotient-e8718d8b1d61d6f70e61da0436f793a461e83bd7.tar.gz
libquotient-e8718d8b1d61d6f70e61da0436f793a461e83bd7.zip
BaseJob::StatusCode: add Error-less synonyms; officially deprecate JsonParseError
-rw-r--r--lib/jobs/basejob.cpp2
-rw-r--r--lib/jobs/basejob.h34
2 files changed, 21 insertions, 15 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index 0d9b9f10..34fc0f57 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -555,8 +555,6 @@ QString BaseJob::statusCaption() const
return tr("Request was abandoned");
case NetworkError:
return tr("Network problems");
- case JsonParseError:
- return tr("Response could not be parsed");
case TimeoutError:
return tr("Request timed out");
case ContentAccessError:
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h
index 4c1c7706..4ee63adb 100644
--- a/lib/jobs/basejob.h
+++ b/lib/jobs/basejob.h
@@ -46,28 +46,36 @@ namespace QMatrixClient
Q_PROPERTY(QUrl requestUrl READ requestUrl CONSTANT)
Q_PROPERTY(int maxRetries READ maxRetries WRITE setMaxRetries)
public:
- /* Just in case, the values are compatible with KJob
- * (which BaseJob used to inherit from). */
enum StatusCode { NoError = 0 // To be compatible with Qt conventions
, Success = 0
, Pending = 1
, WarningLevel = 20
- , UnexpectedResponseTypeWarning = 21
+ , UnexpectedResponseType = 21
+ , UnexpectedResponseTypeWarning = UnexpectedResponseType
, Abandoned = 50 //< A very brief period between abandoning and object deletion
, ErrorLevel = 100 //< Errors have codes starting from this
, NetworkError = 100
- , JsonParseError // TODO: Merge into IncorrectResponseError
- , TimeoutError
+ , Timeout
+ , TimeoutError = Timeout
, ContentAccessError
, NotFoundError
- , IncorrectRequestError
- , IncorrectResponseError
- , TooManyRequestsError
- , RequestNotImplementedError
- , UnsupportedRoomVersionError
- , NetworkAuthRequiredError
- , UserConsentRequiredError
- , UserDefinedError = 200
+ , IncorrectRequest
+ , IncorrectRequestError = IncorrectRequest
+ , IncorrectResponse
+ , IncorrectResponseError = IncorrectResponse
+ , JsonParseError //< deprecated; Use IncorrectResponse instead
+ = IncorrectResponse
+ , TooManyRequests
+ , TooManyRequestsError = TooManyRequests
+ , RequestNotImplemented
+ , RequestNotImplementedError = RequestNotImplemented
+ , UnsupportedRoomVersion
+ , UnsupportedRoomVersionError = UnsupportedRoomVersion
+ , NetworkAuthRequired
+ , NetworkAuthRequiredError = NetworkAuthRequired
+ , UserConsentRequired
+ , UserConsentRequiredError = UserConsentRequired
+ , UserDefinedError = 256
};
/**