From 3bfe40e40183821557845456349e1079af7b4e25 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 23 Dec 2020 17:29:25 +0100 Subject: 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". --- lib/jobs/basejob.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/jobs') 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; -- cgit v1.2.3