From patchwork Mon Feb 17 15:39:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 2845 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C373561944 for ; Mon, 17 Feb 2020 16:39:45 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3DB3652A; Mon, 17 Feb 2020 16:39:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1581953985; bh=ytruXH/aGXRibJkxcNVdfFD28saAfFBNwvg4QL7AjFc=; h=From:To:Cc:Subject:Date:From; b=tkuPp18Qpih0lwnaCz5ZLN0XM6U/xOTeaXTE6QxR+QHR32eUiUrRras7xXNri7rYq AJCPVafpflhbrKYbW0dthcK9bgVVluhr7A+BtxFNTaPaxHQNSqMsdhIb1x7GYESPJM jySh4eW4cl6+LJp+aonxIyNYFKzO1xM8yCBXUY+4= From: Kieran Bingham To: libcamera devel Date: Mon, 17 Feb 2020 15:39:41 +0000 Message-Id: <20200217153941.20713-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] qcam: Use standard PicturesLocation path for capture X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2020 15:39:46 -0000 Utilise the QStandardPaths::PicturesLocation as a starting point for saving images from qcam. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/qcam/main_window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 29eaba8454f8..09e4bfc11300 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -348,8 +349,9 @@ void MainWindow::stopCapture() void MainWindow::saveImageAs() { QImage image = viewfinder_->getCurrentImage(); + QString defaultPath = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last(); - QString filename = QFileDialog::getSaveFileName(this, "Save Image", "", + QString filename = QFileDialog::getSaveFileName(this, "Save Image", defaultPath, "Image Files (*.png *.jpg *.jpeg)"); std::cout << "Save image to " << filename.toStdString() << std::endl;