diff mbox series

[08/11] kernel-shark qt: No error when Record authentication dialog is closed

Message ID 20181121151356.16901-10-ykaradzhov@vmware.com (mailing list archive)
State Superseded
Headers show
Series Small modifications and bug fixes toward KS 1.0 | expand

Commit Message

Yordan Karadzhov Nov. 21, 2018, 3:14 p.m. UTC
No error message must be shown in the case when the user dismissed
the authentication dialog (clicked Cancel).

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/KsMainWindow.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Steven Rostedt Nov. 27, 2018, 8:45 p.m. UTC | #1
On Wed, 21 Nov 2018 15:14:26 +0000
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> No error message must be shown in the case when the user dismissed
> the authentication dialog (clicked Cancel).
> 
> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
>  kernel-shark-qt/src/KsMainWindow.cpp | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/kernel-shark-qt/src/KsMainWindow.cpp b/kernel-shark-qt/src/KsMainWindow.cpp
> index ffb10d4..d5b22dc 100644
> --- a/kernel-shark-qt/src/KsMainWindow.cpp
> +++ b/kernel-shark-qt/src/KsMainWindow.cpp
> @@ -965,6 +965,14 @@ void KsMainWindow::_captureFinished(int exit, QProcess::ExitStatus st)
>  
>  	_captureLocalServer.close();
>  
> +	if (exit == 126) {

Can we make a define for than number?

Thanks,

-- Steve

> +		/*
> +		 * Authorization could not be obtained because the user
> +		 * dismissed the authentication dialog.
> +		 */
> +		return;
> +	}
> +
>  	if (exit != 0 || st != QProcess::NormalExit) {
>  		QString message = "Capture process failed:<br>";
>
diff mbox series

Patch

diff --git a/kernel-shark-qt/src/KsMainWindow.cpp b/kernel-shark-qt/src/KsMainWindow.cpp
index ffb10d4..d5b22dc 100644
--- a/kernel-shark-qt/src/KsMainWindow.cpp
+++ b/kernel-shark-qt/src/KsMainWindow.cpp
@@ -965,6 +965,14 @@  void KsMainWindow::_captureFinished(int exit, QProcess::ExitStatus st)
 
 	_captureLocalServer.close();
 
+	if (exit == 126) {
+		/*
+		 * Authorization could not be obtained because the user
+		 * dismissed the authentication dialog.
+		 */
+		return;
+	}
+
 	if (exit != 0 || st != QProcess::NormalExit) {
 		QString message = "Capture process failed:<br>";