Show a patch.

GET /api/1.1/patches/16696/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 16696,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16696/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16696/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20220719213314.11717-2-laurent.pinchart@ideasonboard.com>",
    "date": "2022-07-19T21:33:14",
    "name": "[libcamera-devel,4/2] libcamera: controls: Drop ControlList::contains()",
    "commit_ref": "4d22621ec11a065b1819f6268335cae81dd50986",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8aa3afc7402da94bdc8c68a04317c60f39c70ff7",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16696/mbox/",
    "series": [
        {
            "id": 3304,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3304/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3304",
            "date": "2022-07-19T21:02:57",
            "name": "[libcamera-devel,1/2] licamera: controls: Drop unnecessary template qualifiers in documentation",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3304/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16696/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16696/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CD32FBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Jul 2022 21:33:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 049E363312;\n\tTue, 19 Jul 2022 23:33:55 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8D076048A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Jul 2022 23:33:52 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 32A88896;\n\tTue, 19 Jul 2022 23:33:52 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658266435;\n\tbh=d7N6GiwgiM2ATu82McMNeRHJeJNGhk3rw/CPJAFEId8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=iGHLKOShMzl85MT8wPZ7XRYXxjNifKz4JpPB/nqNh9MNVyUUk2ZRVF+JCD/7465KY\n\tgZ+xBC5caq6HoTXN96RmQTNK0om9YnkcVxQSJnm3mdqJYhLfG+4mOniPAVTDHdjUZm\n\tZTLu3l482wv1o5M+w4GawBaDu518fd3MZEZ+9hZOBbdJW+j2MiJYbfgkDiSbo4Jsvr\n\tmJsOwdfGhDgmBE9EQWtr8Yi7kXSWt7qZgKtP/DrCAQ3DzYaPnG+mzL9NbRjJWAJErO\n\tgBGcTdJ4jqo5Ls6igTVkfylMtoCw6jL1cdYtjkFv16AYgcpIJe8Iiil5HipsITeY4J\n\tF/FXyLlMPE3Ug==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658266432;\n\tbh=d7N6GiwgiM2ATu82McMNeRHJeJNGhk3rw/CPJAFEId8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=tIvWxNfDBGhBULfowpFRFQmRXpFYn4U1lKHTPHBt0GGiPwfBvJ7r3cVq8VAHOT/jl\n\t1XryiBW4AwyjA0EsFFcZz9zuq2cP9sO84A2dex/ShfUancIrwL6oY2fXLv/fpZwgfC\n\t3nlUXGNOlBt+PsYgUuhtpH2w0oeTZdxaRRZYQVmk="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"tIvWxNfD\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 20 Jul 2022 00:33:14 +0300",
        "Message-Id": "<20220719213314.11717-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220719213314.11717-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20220719210258.5602-1-laurent.pinchart@ideasonboard.com>\n\t<20220719213314.11717-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 4/2] libcamera: controls: Drop\n\tControlList::contains()",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The ControlList::contains(const ControlId &id) function isn't used, as\nit has been replaced by usage of the get() function. Document get as\nbeing the preferred way to check for the presence of a control in a\nControlList, and drop the contains() function.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/controls.h |  1 -\n src/libcamera/controls.cpp   | 15 ++++-----------\n 2 files changed, 4 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 192be78434dc..85a56e621561 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -370,7 +370,6 @@ public:\n \tvoid clear() { controls_.clear(); }\n \tvoid merge(const ControlList &source);\n \n-\tbool contains(const ControlId &id) const;\n \tbool contains(unsigned int id) const;\n \n \ttemplate<typename T>\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 20c27e65e725..df1f0d94c2e6 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -931,17 +931,6 @@ void ControlList::merge(const ControlList &source)\n \t}\n }\n \n-/**\n- * \\brief Check if the list contains a control with the specified \\a id\n- * \\param[in] id The control ID\n- *\n- * \\return True if the list contains a matching control, false otherwise\n- */\n-bool ControlList::contains(const ControlId &id) const\n-{\n-\treturn controls_.find(id.id()) != controls_.end();\n-}\n-\n /**\n  * \\brief Check if the list contains a control with the specified \\a id\n  * \\param[in] id The control numerical ID\n@@ -958,6 +947,10 @@ bool ControlList::contains(unsigned int id) const\n  * \\brief Get the value of control \\a ctrl\n  * \\param[in] ctrl The control\n  *\n+ * Beside getting the value of a control, this function can also be used to\n+ * check if a control is present in the ControlList by converting the returned\n+ * std::optional<T> to bool (or calling its has_value() function).\n+ *\n  * \\return A std::optional<T> containing the control value, or std::nullopt if\n  * the control \\a ctrl is not present in the list\n  */\n",
    "prefixes": [
        "libcamera-devel",
        "4/2"
    ]
}