diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-12-23 17:29:25 +0100 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-12-23 17:29:25 +0100 |
commit | 3bfe40e40183821557845456349e1079af7b4e25 (patch) | |
tree | 38ffead247521bc8291694f10b77e80e9fe4bea5 | |
parent | 84b21debc68b16b7dad7f6ed2e679e1c224956ea (diff) | |
download | libquotient-3bfe40e40183821557845456349e1079af7b4e25.tar.gz libquotient-3bfe40e40183821557845456349e1079af7b4e25.zip |
BaseJob::Status: add comparison with int
Since Status single-parameter constructor is (intentionally)
not explicit, comparisons may not do what's expected in cases like
the one fixed by 3ef036cd. This makes comparisons "do the right thing".
-rw-r--r-- | lib/jobs/basejob.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h index 5c054ed1..a0b89ef7 100644 --- a/lib/jobs/basejob.h +++ b/lib/jobs/basejob.h @@ -136,6 +136,14 @@ public: { return !operator==(other); } + bool operator==(int otherCode) const + { + return code == otherCode; + } + bool operator!=(int otherCode) const + { + return !operator==(otherCode); + } int code; QString message; |