Show a patch.

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

{
    "id": 16995,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16995/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16995/",
    "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": "<20220806190433.59128-3-utkarsh02t@gmail.com>",
    "date": "2022-08-06T19:04:31",
    "name": "[libcamera-devel,v2,2/4] qcam: Support Hotplug for Camera Selection Dialog",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "a4e33853d3aba0b1fcf9711dd2ed0919ddc38afd",
    "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/16995/mbox/",
    "series": [
        {
            "id": 3379,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3379/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3379",
            "date": "2022-08-06T19:04:29",
            "name": "Improve Camera Selection GUI in QCam",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3379/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16995/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16995/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 157DBBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  6 Aug 2022 19:04:57 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BFA166332B;\n\tSat,  6 Aug 2022 21:04:56 +0200 (CEST)",
            "from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com\n\t[IPv6:2607:f8b0:4864:20::1036])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C5FDC61FAC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  6 Aug 2022 21:04:54 +0200 (CEST)",
            "by mail-pj1-x1036.google.com with SMTP id\n\t15-20020a17090a098f00b001f305b453feso11082375pjo.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 06 Aug 2022 12:04:54 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:daa9:adf3:a099:1bff:e55])\n\tby smtp.gmail.com with ESMTPSA id\n\tz17-20020aa79911000000b0052f20d70845sm406025pff.150.2022.08.06.12.04.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 06 Aug 2022 12:04:52 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659812696;\n\tbh=5iS60UGDecVEyrrgT3lKElBN6R9iQM81Khz3N/3B3JI=;\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=jRePL41aKyB3J2esUHzBgrqkYx3skdDjSuwwzL7NAs4Vd8JkbpQMWf9IfiWiThOCO\n\tgDulYZRqvA7ENot8VLlLc1AMzX/lDskF6aoWI5PUfnWN17NAKMT0VwVfKSZeOXAbGO\n\tbrjwBOI5E+jXXnLEOo7FrxB5NhO0vMZVMmD0mK7nXpLjcqMgE51nXdZ4wDLugBmPJn\n\tjrJHVcQtiOjFWBRVDmPGsKVL2LSfT7rOfyOA6r5lboE2il68DZ7oLyp5ewNFs8d5Hm\n\tK+ByS06Y/SDrXre37tDcTgU1zB9Gq+3x32/DWaiJWsrJIPD3yMGPWp9MNjsmH2kzRQ\n\tjOF4cqdlu67xw==",
            "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=/g1b3Wfsbg0FDtmfKPifPvuYv+phjnLqZvK2o34f6LA=;\n\tb=F4lDk+3vS9o+WD0z4H5OnPwMx1o1+45KzjlZp6U/frzKC9eBilsRMRpATH57YxZJjl\n\tJp3PIhwLJg4LWtb+Sn0TTqlFWXWOPcngwghUnDi516IMs2y8bI80trOXJNNRh1BG3OFR\n\tX9NZzuru2T/H6FOOcmmjuX0OciJ8/wYpzyIgZA8rMZBmdnEEJaBgnWTNFuZWbug9cDEu\n\t3hUFmPwaqlb33s8klAc/13mm1ZGyS0cafqX/jHg/z1ALLHrnOpTf4v5C/zqjq4nmCknK\n\tK6MgcZzjnvLpVFTiuRjcidn3bd+YbikU+9x3zvJmOP42klLuXYQS84xkzBzTzkiYepUL\n\tKcKg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"F4lDk+3v\"; 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=/g1b3Wfsbg0FDtmfKPifPvuYv+phjnLqZvK2o34f6LA=;\n\tb=FPE1AlAQ7G+aPT8yAWvipada0fhuhP5KuM7anyWzH72R+IyOU1XYo51r4QMZm1/EPI\n\t5/kE93z3g+nHwa/oo3Oe57HT7LgVGirtZspJrIBRDzRX8qTnB4XCRSUi9mYIGOSM+Nec\n\t06r3uRBjTpN5/DAOY7ZEk66VQ1vdcmMT8E3yJpUmxJeZn14JOuX4p60vqp9YQea1Lk44\n\tzIHWugQFe+/O2OQADjOiyF1SMdRRtdaPimy2/+PPQPuuXGj5KWgnOe8tuxTKBn6h+pmH\n\t/HzP8fleqpou/hfkCj/4ZrVN3KZM2Mtqe+j5Z4aZZo8urDAwa6kAU/ofUlW7nwAEunv+\n\tQIiA==",
        "X-Gm-Message-State": "ACgBeo1i5wkrw+MaFb8VcAc7QjTLVqULFs6PCIXI0rPIB32oYeTqex4b\n\tJ9AVrNakuWNEmGMYQudoTgQQ2qvhD6M=",
        "X-Google-Smtp-Source": "AA6agR44/EhYbKguoMY90cGXe96vJU2nhhlOqM3VzciWJQ2uhiXMW3Ilf3NxXuJW1z0R/dIejrB0BA==",
        "X-Received": "by 2002:a17:90b:1b07:b0:1f5:115c:79a4 with SMTP id\n\tnu7-20020a17090b1b0700b001f5115c79a4mr13504441pjb.166.1659812692848; \n\tSat, 06 Aug 2022 12:04:52 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sun,  7 Aug 2022 00:34:31 +0530",
        "Message-Id": "<20220806190433.59128-3-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220806190433.59128-1-utkarsh02t@gmail.com>",
        "References": "<20220806190433.59128-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 2/4] 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---\n src/qcam/cam_select_dialog.h | 14 ++++++++++++++\n src/qcam/main_window.cpp     |  6 ++++++\n 2 files changed, 20 insertions(+)",
    "diff": "diff --git a/src/qcam/cam_select_dialog.h b/src/qcam/cam_select_dialog.h\nindex c23bad59..ee65eb88 100644\n--- a/src/qcam/cam_select_dialog.h\n+++ b/src/qcam/cam_select_dialog.h\n@@ -56,6 +56,20 @@ public:\n \t\treturn cameraIdComboBox_->currentText().toStdString();\n \t}\n \n+\t/* Hotplug / Unplug Support. */\n+\tvoid cameraAdded(libcamera::Camera *camera)\n+\t{\n+\t\tcameraIdComboBox_->addItem(QString::fromStdString(camera->id()));\n+\t}\n+\n+\tvoid cameraRemoved(libcamera::Camera *camera)\n+\t{\n+\t\tint cameraIndex = cameraIdComboBox_->findText(\n+\t\t\tQString::fromStdString(camera->id()));\n+\n+\t\tcameraIdComboBox_->removeItem(cameraIndex);\n+\t}\n+\n private:\n \tlibcamera::CameraManager *cm_;\n \ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 758e2c94..dd30817d 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -594,6 +594,9 @@ void MainWindow::processHotplug(HotplugEvent *e)\n \n \tif (event == HotplugEvent::HotPlug) {\n \t\tcameraCombo_->addItem(QString::fromStdString(camera->id()));\n+\n+\t\tif (camSelectDialog_)\n+\t\t\tcamSelectDialog_->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 +608,9 @@ void MainWindow::processHotplug(HotplugEvent *e)\n \n \t\tint camIndex = cameraCombo_->findText(QString::fromStdString(camera->id()));\n \t\tcameraCombo_->removeItem(camIndex);\n+\n+\t\tif (camSelectDialog_)\n+\t\t\tcamSelectDialog_->cameraRemoved(camera);\n \t}\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/4"
    ]
}