From 3a8d543c72969c7fda7cdd1cdda2f17948a1e68e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 1 Oct 2019 15:58:02 +0200 Subject: [PATCH] [libcalamares] Document operator bool() of JobResult - this could be named isValid() instead, but basically the idea is that this code makes sense: JobResult r = do_thing(); if ( !r ) { /* Error happened! */ return r; } /* Carry on .. */ --- src/libcalamares/Job.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcalamares/Job.h b/src/libcalamares/Job.h index 3eaa251ef..bddd0277c 100644 --- a/src/libcalamares/Job.h +++ b/src/libcalamares/Job.h @@ -46,11 +46,16 @@ public: InvalidConfiguration = 2 }; + // Can't copy, but you can keep a temporary JobResult( const JobResult& rhs ) = delete; JobResult( JobResult&& rhs ); virtual ~JobResult() {} + /** @brief Is this JobResult a success? + * + * Equivalent to errorCode() == 0, might be named isValid(). + */ virtual operator bool() const; virtual QString message() const;