[3/3] kernel-shark: Use standart error message in KsMainWindow::_record()
diff mbox series

Message ID 20190809080623.7548-4-y.karadz@gmail.com
State Superseded
Headers show
Series
  • Handle the case when KernelShark is started as Root
Related show

Commit Message

Yordan Karadzhov (VMware) Aug. 9, 2019, 8:06 a.m. UTC
The error message is printed using the method KsMainWindow::_error().
The message itself remains unchanged. If we want to change the message,
this can be done in another patch.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsMainWindow.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Steven Rostedt Aug. 9, 2019, 1:35 p.m. UTC | #1
On Fri,  9 Aug 2019 11:06:23 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

Typo in subject "standard".

Other than that, it looks good.

-- Steve


> The error message is printed using the method KsMainWindow::_error().
> The message itself remains unchanged. If we want to change the message,
> this can be done in another patch.
> 
> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
> ---
>  kernel-shark/src/KsMainWindow.cpp | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
> index e9c6d54..b462ded 100644
> --- a/kernel-shark/src/KsMainWindow.cpp
> +++ b/kernel-shark/src/KsMainWindow.cpp
> @@ -890,7 +890,6 @@ void KsMainWindow::_record()
>  #endif
>  
>  	if (geteuid() && !canDoAsRoot) {
> -		QErrorMessage *em = new QErrorMessage(this);
>  		QString message;
>  
>  		message = "Record is currently not supported.";
> @@ -899,8 +898,7 @@ void KsMainWindow::_record()
>  		message += " ./cmake_clean.sh <br> cmake .. <br> make <br>";
>  		message += " sudo make install";
>  
> -		em->showMessage(message);
> -		qCritical() << "ERROR: " << message;
> +		_error(message, "recordCantStart", false, false);
>  		return;
>  	}
>

Patch
diff mbox series

diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index e9c6d54..b462ded 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -890,7 +890,6 @@  void KsMainWindow::_record()
 #endif
 
 	if (geteuid() && !canDoAsRoot) {
-		QErrorMessage *em = new QErrorMessage(this);
 		QString message;
 
 		message = "Record is currently not supported.";
@@ -899,8 +898,7 @@  void KsMainWindow::_record()
 		message += " ./cmake_clean.sh <br> cmake .. <br> make <br>";
 		message += " sudo make install";
 
-		em->showMessage(message);
-		qCritical() << "ERROR: " << message;
+		_error(message, "recordCantStart", false, false);
 		return;
 	}