[libcamera-devel,v2,4/5] qcam: Add the version string to the title

Message ID 20190704130347.9372-9-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • Untitled series #404
Related show

Commit Message

Kieran Bingham July 4, 2019, 1:03 p.m. UTC
Provide the version string reported by the libcamera library on the qcam
test utility.

This helps confirm the exact version of the library that is being used
while testing.

The version string is stored in the MainWindow so that it can be reused
without reconstructing.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/qcam/main_window.cpp | 4 ++++
 src/qcam/main_window.h   | 1 +
 2 files changed, 5 insertions(+)

Comments

Laurent Pinchart July 4, 2019, 1:47 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Thu, Jul 04, 2019 at 02:03:46PM +0100, Kieran Bingham wrote:
> Provide the version string reported by the libcamera library on the qcam
> test utility.
> 
> This helps confirm the exact version of the library that is being used
> while testing.
> 
> The version string is stored in the MainWindow so that it can be reused
> without reconstructing.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/qcam/main_window.cpp | 4 ++++
>  src/qcam/main_window.h   | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index 0f737d852960..d61369109d66 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -14,6 +14,7 @@
>  #include <QTimer>
>  
>  #include <libcamera/camera_manager.h>
> +#include <libcamera/version.h>
>  
>  #include "main_window.h"
>  #include "viewfinder.h"
> @@ -25,6 +26,9 @@ MainWindow::MainWindow(const OptionsParser::Options &options)
>  {
>  	int ret;
>  
> +	title_ = "QCam " + QString::fromStdString(libcamera::version);
> +	setWindowTitle(title_);
> +
>  	viewfinder_ = new ViewFinder(this);
>  	setCentralWidget(viewfinder_);
>  	viewfinder_->setFixedSize(500, 500);
> diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h
> index 345bdaaed354..46a494a9d783 100644
> --- a/src/qcam/main_window.h
> +++ b/src/qcam/main_window.h
> @@ -42,6 +42,7 @@ private:
>  			     const std::map<Stream *, Buffer *> &buffers);
>  	int display(Buffer *buffer);
>  
> +	QString title_;
>  	const OptionsParser::Options &options_;
>  
>  	std::shared_ptr<Camera> camera_;

Patch

diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index 0f737d852960..d61369109d66 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -14,6 +14,7 @@ 
 #include <QTimer>
 
 #include <libcamera/camera_manager.h>
+#include <libcamera/version.h>
 
 #include "main_window.h"
 #include "viewfinder.h"
@@ -25,6 +26,9 @@  MainWindow::MainWindow(const OptionsParser::Options &options)
 {
 	int ret;
 
+	title_ = "QCam " + QString::fromStdString(libcamera::version);
+	setWindowTitle(title_);
+
 	viewfinder_ = new ViewFinder(this);
 	setCentralWidget(viewfinder_);
 	viewfinder_->setFixedSize(500, 500);
diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h
index 345bdaaed354..46a494a9d783 100644
--- a/src/qcam/main_window.h
+++ b/src/qcam/main_window.h
@@ -42,6 +42,7 @@  private:
 			     const std::map<Stream *, Buffer *> &buffers);
 	int display(Buffer *buffer);
 
+	QString title_;
 	const OptionsParser::Options &options_;
 
 	std::shared_ptr<Camera> camera_;