aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'jobs')
-rw-r--r--jobs/basejob.cpp2
-rw-r--r--jobs/basejob.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp
index 2a28f11e..1f079966 100644
--- a/jobs/basejob.cpp
+++ b/jobs/basejob.cpp
@@ -70,7 +70,7 @@ class BaseJob::Private
QByteArrayList expectedContentTypes;
QScopedPointer<QNetworkReply, NetworkReplyDeleter> reply;
- Status status = NoError;
+ Status status = Pending;
QTimer timer;
QTimer retryTimer;
diff --git a/jobs/basejob.h b/jobs/basejob.h
index daca1e79..1fe3a24d 100644
--- a/jobs/basejob.h
+++ b/jobs/basejob.h
@@ -50,6 +50,7 @@ namespace QMatrixClient
* (which BaseJob used to inherit from). */
enum StatusCode { NoError = 0 // To be compatible with Qt conventions
, Success = 0
+ , Pending = 1
, ErrorLevel = 100 // Errors have codes starting from this
, NetworkError = 100
, JsonParseError
@@ -291,4 +292,9 @@ namespace QMatrixClient
class Private;
QScopedPointer<Private> d;
};
+
+ inline bool isJobRunning(BaseJob* job)
+ {
+ return job && job->error() == BaseJob::Pending;
+ }
} // namespace QMatrixClient