Show a patch.

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

{
    "id": 17068,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17068/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17068/",
    "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": "<20220810150349.414043-3-utkarsh02t@gmail.com>",
    "date": "2022-08-10T15:03:43",
    "name": "[libcamera-devel,v8,2/8] qcam: Support Hotplug for Camera Selection Dialog",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "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/17068/mbox/",
    "series": [
        {
            "id": 3402,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3402/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3402",
            "date": "2022-08-10T15:03:41",
            "name": "Introduce capture scripts to qcam",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/3402/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17068/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17068/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 62221C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 15:04:03 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 781926332C;\n\tWed, 10 Aug 2022 17:04:02 +0200 (CEST)",
            "from mail-pf1-x429.google.com (mail-pf1-x429.google.com\n\t[IPv6:2607:f8b0:4864:20::429])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0206A63328\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 17:04:01 +0200 (CEST)",
            "by mail-pf1-x429.google.com with SMTP id u133so13933069pfc.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 08:04:00 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d2bc:2a55:4cae:bf8f:f4ed])\n\tby smtp.gmail.com with ESMTPSA id\n\tb3-20020a1709027e0300b0016f1319d2a7sm12882624plm.297.2022.08.10.08.03.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Aug 2022 08:03:59 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660143842;\n\tbh=a6AwtFQ3QrVrUPnhwmhPFs0L5JDLFHpteCPdPaZ6JNg=;\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=b6fLXWjej3k40xaG6ipmdRvb5zZok4T0FPlfBnkmcbeueKdp7sqi6zCyiIIePkH01\n\tsjr454s5Dmlpa8teGyjt6SvmGTJSOm+vZ8ei0hIIUCAANxXxMVsaNxzP4mGGKZX4Fm\n\t6xyVsn50dzli2U22xMFZXP91yFhZeRZs7Aoyd7/woSy8JQotq0QOae2gpl63cIIcOZ\n\taGtSTPTidlD6lX+DNgXw9mJ384mm3AYnlH8iZelU7IWaBM6wEwTAbKYzH/wl9AOUQE\n\tjgPTpeu5/b2879R2yeeaLXq2b34A/yRVXVl9o+alU/UZacpMw8n3BgDZCVoITp4ci/\n\tOcClCeOGY1W8Q==",
            "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=kvufxfZHW8jFx4wZYakmIfbO7HxI/zGP6BLC7jNXmrs=;\n\tb=pSWLGJJ4e4geNPryAV2dwBatxEftailbcpjpshC26dazVDCxp2Zddd6z0XG1QKiuJo\n\tIKRG+gJ5suKhQgqbAmnkZLVmwCe0SwBegMPemTyS8MzWeW9HzCo1CRWrhqkxuRDyiiIN\n\t6FYzMIR+rJ1XFJQPz+WqZhRzn7LTEk4h32eK0S5elrl35QRF9d2LzWLGPk0fgEpgNLT6\n\tZQto+aOhH/oqyzP1Cbua1/SvSulx5aYh6FwxV2Xom+NBXNB8zXlfHgMKvUm/JyJ3qs33\n\t8GmhUueIabmJcxwJOfDtHHx7WTUNGDMGYXwwj8KDEivEjfvqfTm/P3+EnYMx4yLoQxi8\n\t/P2g=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"pSWLGJJ4\"; 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=kvufxfZHW8jFx4wZYakmIfbO7HxI/zGP6BLC7jNXmrs=;\n\tb=JRErbSRWsN+Y+/dOiZ2GlgXcaXzWSTjnzpdu8jRAIGi6F6wxO7L0jHWC5+HUMXSuGZ\n\tH/R2FsgTaaXomU5V9wPOjtzMlsFl5pq8GznF5fkLkxaH4FziTtJhd41VXImyrLGggnVp\n\tgJ2Sk2r5IBc9Yn/wwKxVAFmevkS3fNCFHncMsnXK+QxOjywilHux8mRtF7XVAWYS0c3u\n\tx8zCTeyJ9Qzfdt4gJzkCHrTktLgBNoCrl4NbhXhunXPls1JEFT7cJlq21vIB7f/2nYZ0\n\teA9jusdXk5GYLjVkJR/PrZeNFwuI5HO12gayizEnykm93skoyOxuwITgsy+tX8iNshdw\n\tlmdg==",
        "X-Gm-Message-State": "ACgBeo1Ffmzo7vIDcrzIVGEe+aDrHHa5ILPIl3Yl8bSTk/diJzkf1Jp1\n\ttJPh0niRvoWx97wZ/K3V+3kYX2NhDv0=",
        "X-Google-Smtp-Source": "AA6agR5Y6PDit0QuxTah73xhgHw4zfTrP80aptT50jsG/OMxdHQvfqvWG3IDTGyHguL7EfpoUWK7hg==",
        "X-Received": "by 2002:a05:6a00:1d84:b0:52f:4a8f:7381 with SMTP id\n\tz4-20020a056a001d8400b0052f4a8f7381mr14445905pfw.52.1660143839389; \n\tWed, 10 Aug 2022 08:03:59 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 10 Aug 2022 20:33:43 +0530",
        "Message-Id": "<20220810150349.414043-3-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220810150349.414043-1-utkarsh02t@gmail.com>",
        "References": "<20220810150349.414043-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v8 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>\n---\nDifference from v7:\n\t1. Nothing\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 5544f49a..04c71fd8 100644\n--- a/src/qcam/cam_select_dialog.h\n+++ b/src/qcam/cam_select_dialog.h\n@@ -26,6 +26,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 e794221a..9ec94708 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -594,6 +594,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@@ -605,6 +607,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",
        "v8",
        "2/8"
    ]
}