From 59bbe67c490ba4e993dd332208fc8cbeeb933c71 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jan 2018 19:35:26 +0900 Subject: isJobRunning() facility function --- jobs/basejob.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jobs/basejob.h b/jobs/basejob.h index e3a379fa..2f75c095 100644 --- a/jobs/basejob.h +++ b/jobs/basejob.h @@ -51,6 +51,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 @@ -279,4 +280,9 @@ namespace QMatrixClient class Private; QScopedPointer d; }; + + inline bool isJobRunning(BaseJob* job) + { + return job && job->error() == BaseJob::Pending; + } } // namespace QMatrixClient -- cgit v1.2.3