From 8a769cddcd1a063dd9400518ff65c0b1f1aec1b4 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sun, 28 Nov 2021 16:53:51 +0100 Subject: Comment on const return types in event.h Proper linters recognise that the returned types are not primitive, while people might still be confused a bit. --- lib/events/event.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/events/event.h') diff --git a/lib/events/event.h b/lib/events/event.h index e45fecca..998a386c 100644 --- a/lib/events/event.h +++ b/lib/events/event.h @@ -220,6 +220,9 @@ public: // a "content" object; but since its structure is different for // different types, we're implementing it per-event type. + // NB: const return types below are meant to catch accidental attempts + // to change event JSON (e.g., consider contentJson()["inexistentKey"]). + const QJsonObject contentJson() const; template -- cgit v1.2.3