Show a patch.

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

{
    "id": 3617,
    "url": "https://patchwork.libcamera.org/api/patches/3617/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3617/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20200430003604.2423018-4-niklas.soderlund@ragnatech.se>",
    "date": "2020-04-30T00:36:02",
    "name": "[libcamera-devel,RFC/PATCH,3/5] qcam: Add an option to allow specifying output path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b9c06d1e92792146c3af3e66c641c3b78b74fbf1",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3617/mbox/",
    "series": [
        {
            "id": 855,
            "url": "https://patchwork.libcamera.org/api/series/855/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=855",
            "date": "2020-04-30T00:36:00",
            "name": "qcam: Add RAW capture support",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/855/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3617/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3617/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8194260AF5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Apr 2020 02:36:37 +0200 (CEST)",
            "from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de\n\t[79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 872db93e-8a7a-11ea-89d0-0050569116f7;\n\tThu, 30 Apr 2020 02:35:44 +0200 (CEST)"
        ],
        "X-Halon-ID": "872db93e-8a7a-11ea-89d0-0050569116f7",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 30 Apr 2020 02:36:02 +0200",
        "Message-Id": "<20200430003604.2423018-4-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.26.0",
        "In-Reply-To": "<20200430003604.2423018-1-niklas.soderlund@ragnatech.se>",
        "References": "<20200430003604.2423018-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC/PATCH 3/5] qcam: Add an option to allow\n\tspecifying output path",
        "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>",
        "X-List-Received-Date": "Thu, 30 Apr 2020 00:36:37 -0000"
    },
    "content": "Add a command line option to specify an output path for files captured.\nThis will become more useful when JPEG capture is turned into an quick\noperation instead of using a QFileDialog and when RAW capture support is\nadded.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/qcam/main.cpp        | 3 +++\n src/qcam/main_window.cpp | 8 ++++++--\n src/qcam/main_window.h   | 2 ++\n 3 files changed, 11 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/qcam/main.cpp b/src/qcam/main.cpp\nindex cd73fa764614e7e7..2999e4959d8ecff8 100644\n--- a/src/qcam/main.cpp\n+++ b/src/qcam/main.cpp\n@@ -34,6 +34,9 @@ OptionsParser::Options parseOptions(int argc, char *argv[])\n \t\t\t \"help\");\n \tparser.addOption(OptStream, &streamKeyValue,\n \t\t\t \"Set configuration of a camera stream\", \"stream\", true);\n+\tparser.addOption(OptSavePath, OptionString,\n+\t\t\t \"Path to qcam picture storage\",\n+\t\t\t \"output-dir\", ArgumentRequired, \"path\");\n \n \tOptionsParser::Options options = parser.parse(argc, argv);\n \tif (options.isSet(OptHelp))\ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex e77bc01df8f3edfe..470f78162cabffe5 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -75,6 +75,11 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)\n \t\treturn;\n \t}\n \n+\tif (options_.isSet(OptSavePath))\n+\t\tdefaultPath_ = QString::fromUtf8(options_[OptSavePath].toString().c_str());\n+\telse\n+\t\tdefaultPath_ = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);\n+\n \tstartStopAction_->setChecked(true);\n }\n \n@@ -507,9 +512,8 @@ void MainWindow::stopCapture()\n void MainWindow::saveImageAs()\n {\n \tQImage image = viewfinder_->getCurrentImage();\n-\tQString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);\n \n-\tQString filename = QFileDialog::getSaveFileName(this, \"Save Image\", defaultPath,\n+\tQString filename = QFileDialog::getSaveFileName(this, \"Save Image\", defaultPath_,\n \t\t\t\t\t\t\t\"Image Files (*.png *.jpg *.jpeg)\");\n \tif (filename.isEmpty())\n \t\treturn;\ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex c2040c0ebcd61bfa..7b8a185511e17a8f 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -33,6 +33,7 @@ class QAction;\n enum {\n \tOptCamera = 'c',\n \tOptHelp = 'h',\n+\tOptSavePath = 'o',\n \tOptStream = 's',\n };\n \n@@ -83,6 +84,7 @@ private:\n \n \t/* Options */\n \tconst OptionsParser::Options &options_;\n+\tQString defaultPath_;\n \n \t/* Camera manager, camera, configuration and buffers */\n \tCameraManager *cm_;\n",
    "prefixes": [
        "libcamera-devel",
        "RFC/PATCH",
        "3/5"
    ]
}