Show a patch.

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

{
    "id": 17054,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17054/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17054/",
    "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": "<20220809205042.344923-3-utkarsh02t@gmail.com>",
    "date": "2022-08-09T20:50:36",
    "name": "[libcamera-devel,v7,2/8] qcam: Support Hotplug for Camera Selection Dialog",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9345af1378db39be218d812fc81cbb764955a16a",
    "submitter": {
        "id": 114,
        "url": "https://patchwork.libcamera.org/api/1.1/people/114/?format=api",
        "name": "Utkarsh Tiwari",
        "email": "utkarsh02t@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17054/mbox/",
    "series": [
        {
            "id": 3400,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3400/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3400",
            "date": "2022-08-09T20:50:34",
            "name": "Introduce capture scripts to qcam",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/3400/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17054/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17054/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 5B66ABE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Aug 2022 20:51:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 165DE6332E;\n\tTue,  9 Aug 2022 22:51:02 +0200 (CEST)",
            "from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com\n\t[IPv6:2607:f8b0:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F333C63328\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Aug 2022 22:50:59 +0200 (CEST)",
            "by mail-pf1-x42f.google.com with SMTP id 130so11817411pfv.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 09 Aug 2022 13:50:59 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d2bc:2358:3bcd:fb4f:cbb7])\n\tby smtp.gmail.com with ESMTPSA id\n\td3-20020a623603000000b0052d981e7842sm301936pfa.208.2022.08.09.13.50.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 09 Aug 2022 13:50:58 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660078262;\n\tbh=Jr3N5xZ/pt0OpbqVWsjfe9vtI7OL/MbZ6n1JpILI72Y=;\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=HMWNBGRQgbYzgT4hJtxTafZBB8+uRY4/8R0jEg440WMbODKRcjhT92ynq8x+wu0i6\n\twp4aMeHfSE4jcfqHn9irL/Oqi+qoqecZBgSXhIyr+LsFLxvopuuG3qx616jS6RVnV2\n\tz+iGwf5zXNw8PnWRm3Cf2Tg0I1U1u3NhAANDpAMb92Z9gjtTVldjJWNKTHaxtWCxij\n\to2/tGS1ifgLWQO3J9r/X4eYCY4cW1JffANL3/RDRMiAbgwwP7kLuvJxYf91qj8Yrpw\n\t9E2XC0Dufy/S7UN5c1RjjfQO7apRYSniWAmCQQrca7vGDO5K1fYaBNt9C2xguZOS+m\n\t9PErkHWJkeJeA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=MXl7enM09lK80T/81FGaBB7h+PlTHLqNA78faA96bmc=;\n\tb=pFRj4lnMq+W/Qzq8mmRjGgR+QZwfQ1rVG4RBX9PfiwUAilRXEZ0qzqCl6bIrbJSmj/\n\teik7NkKROpD+bmAE3PaX3YhAocmvjEtmRTqfO9mIpOfHeOII8efUhCdMOfsj5XuFMb9n\n\tNODhRHl1cLMyQDSURpFGM7aiQjUEbwHuhdSmY9N2/6NgFpp8S20MP2SCxLsHgnjqmDyN\n\tgY9+SoM3sUcUDonIvxXTRyWVOGnENEjktqH/OxeZttJO2T6PQWLsQkWhtAv9k0JVSKI9\n\ta5CVYyG1/hanfeO8icHdZXi7O3j7pE/nOf3HB1V1+HFdDE6ZHUn1azz9ttxwuvaDupmR\n\tbUnw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"pFRj4lnM\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc;\n\tbh=MXl7enM09lK80T/81FGaBB7h+PlTHLqNA78faA96bmc=;\n\tb=To7DQEzPSkTRepsYD/+fBAhfczh7bSHxJ/TCF6JJBcrJeVt8v2I2Mz6tOW0s/X2fFR\n\t06drEAlPN/KVGe28Gu9+fmweTZV3xwhkrYFCrZ+GxGtg1cqionUo3RdZ8J11O0PwQL67\n\tU3BE/AHg87hxiBBosx1JifULAqCck5KthoCL6gJOjrgATKQBM4Aas20tR6+s2KuPnbqv\n\tPbdgyC6GXRMvGzUeeJbrZ2m3m7B1pzhOVBGv07xo6z3ze6d3WOsUFBtL64zj9yIA0BuM\n\t49K569bK8L8MpbJvnrfc3b/VhhAHzMfr/nKWRMMj8UTgwWOda6moEXpWtRar0AWGQd06\n\tQQFQ==",
        "X-Gm-Message-State": "ACgBeo1iM0bm0+SJSBc/ndRzi2XQkB1Io7czg9t08qPRgpCXGfU6Kh9s\n\tLxe5cTIe4MA18g87oUF28tH9DBsJIJU=",
        "X-Google-Smtp-Source": "AA6agR75QJoIaSc7v4srUDdaiDfJmmdzzy/4dYspseaIV/LRpKuTke2jDh/VaKKyXRzJFfYtteIWlg==",
        "X-Received": "by 2002:aa7:8c51:0:b0:528:2ed8:7e35 with SMTP id\n\te17-20020aa78c51000000b005282ed87e35mr24012073pfd.13.1660078258364; \n\tTue, 09 Aug 2022 13:50:58 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 10 Aug 2022 02:20:36 +0530",
        "Message-Id": "<20220809205042.344923-3-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220809205042.344923-1-utkarsh02t@gmail.com>",
        "References": "<20220809205042.344923-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v7 2/8] qcam: Support Hotplug for Camera\n\tSelection Dialog",
        "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": "Utkarsh Tiwari via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Utkarsh Tiwari <utkarsh02t@gmail.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Currently if there is HotPlug event when the user is on the Camera\nselection dialog, the QComboBox didn't update to reflect the change.\n\nIf the QDialog exists then alert it for the Hotplug event. The check\nfor QDialog existance is done by QPointer.\n\nSigned-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\nDifference:\n\t1. Moved functions implementation to its own .cpp\n src/qcam/cam_select_dialog.cpp | 14 ++++++++++++++\n src/qcam/cam_select_dialog.h   |  4 ++++\n src/qcam/main_window.cpp       |  4 ++++\n 3 files changed, 22 insertions(+)",
    "diff": "diff --git a/src/qcam/cam_select_dialog.cpp b/src/qcam/cam_select_dialog.cpp\nindex dceaa590..d8982800 100644\n--- a/src/qcam/cam_select_dialog.cpp\n+++ b/src/qcam/cam_select_dialog.cpp\n@@ -49,3 +49,17 @@ std::string CameraSelectorDialog::getCameraId()\n {\n \treturn cameraIdComboBox_->currentText().toStdString();\n }\n+\n+/* Hotplug / Unplug Support. */\n+void CameraSelectorDialog::cameraAdded(libcamera::Camera *camera)\n+{\n+\tcameraIdComboBox_->addItem(QString::fromStdString(camera->id()));\n+}\n+\n+void CameraSelectorDialog::cameraRemoved(libcamera::Camera *camera)\n+{\n+\tint cameraIndex = cameraIdComboBox_->findText(\n+\t\tQString::fromStdString(camera->id()));\n+\n+\tcameraIdComboBox_->removeItem(cameraIndex);\n+}\ndiff --git a/src/qcam/cam_select_dialog.h b/src/qcam/cam_select_dialog.h\nindex 8e54f916..567083ae 100644\n--- a/src/qcam/cam_select_dialog.h\n+++ b/src/qcam/cam_select_dialog.h\n@@ -29,6 +29,10 @@ public:\n \n \tstd::string getCameraId();\n \n+\t/* Hotplug / Unplug Support. */\n+\tvoid cameraAdded(libcamera::Camera *camera);\n+\n+\tvoid cameraRemoved(libcamera::Camera *camera);\n private:\n \tlibcamera::CameraManager *cm_;\n \ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 48479f35..377b4650 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -593,6 +593,8 @@ void MainWindow::processHotplug(HotplugEvent *e)\n \n \tif (event == HotplugEvent::HotPlug) {\n \t\tcameraCombo_->addItem(QString::fromStdString(camera->id()));\n+\n+\t\tcameraSelectorDialog_->cameraAdded(camera);\n \t} else if (event == HotplugEvent::HotUnplug) {\n \t\t/* Check if the currently-streaming camera is removed. */\n \t\tif (camera == camera_.get()) {\n@@ -604,6 +606,8 @@ void MainWindow::processHotplug(HotplugEvent *e)\n \n \t\tint camIndex = cameraCombo_->findText(QString::fromStdString(camera->id()));\n \t\tcameraCombo_->removeItem(camIndex);\n+\n+\t\tcameraSelectorDialog_->cameraRemoved(camera);\n \t}\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "v7",
        "2/8"
    ]
}