diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-28 11:00:39 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-28 11:00:39 +0900 |
commit | baca58ea5c271333038ad13466eeb7acc50ecdde (patch) | |
tree | 5bccb75fc906cfb473bc2116bbbaaabe267d3c5d /lib/jobs/basejob.h | |
parent | 9a4d2414895cd80e379f8bd5a22ff66afbae9856 (diff) | |
download | libquotient-baca58ea5c271333038ad13466eeb7acc50ecdde.tar.gz libquotient-baca58ea5c271333038ad13466eeb7acc50ecdde.zip |
BaseJob: support status tracking
The newly introduced statusChanged() signal allows clients to be
notified about the job state transitions.
Diffstat (limited to 'lib/jobs/basejob.h')
-rw-r--r-- | lib/jobs/basejob.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h index eec09506..6c91a333 100644 --- a/lib/jobs/basejob.h +++ b/lib/jobs/basejob.h @@ -107,6 +107,15 @@ namespace QMatrixClient << s.code << ": " << s.message; } + bool operator==(const Status& other) const + { + return code == other.code && message == other.message; + } + bool operator!=(const Status& other) const + { + return !operator==(other); + } + int code; QString message; }; @@ -156,6 +165,9 @@ namespace QMatrixClient /** The job has sent a network request */ void started(); + /** The job has changed its status */ + void statusChanged(Status newStatus); + /** * The previous network request has failed; the next attempt will * be done in the specified time |