linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>, linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 4/4] kernel-shark: Use <br> for dialog and \n for console error messages
Date: Wed, 17 Jul 2019 09:55:59 +0300	[thread overview]
Message-ID: <53f66061-89a4-8d81-f618-ef3a7b573517@gmail.com> (raw)
In-Reply-To: <20190710134725.599995325@goodmis.org>


On 10.07.19 г. 16:46 ч., Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> The Qt dialog boxes require '<br>' to print a new line but consoles require
> a '\n'. Instead of printing '<br>' to the console or '\n' to the dialog,
> always have the '\n' turn into '<br>' for the dialog and all '<br>' turn
> into '\n' for the console.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>   kernel-shark/src/KsMainWindow.cpp | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
> index 54aa6d782ad1..29d44d9a9230 100644
> --- a/kernel-shark/src/KsMainWindow.cpp
> +++ b/kernel-shark/src/KsMainWindow.cpp
> @@ -1028,10 +1028,12 @@ void KsMainWindow::loadDataFile(const QString& fileName)
>   	}
>   }
>   
> -void KsMainWindow::_error(const QString &text, const QString &errCode,
> +void KsMainWindow::_error(const QString &mesg, const QString &errCode,
>   			  bool resize, bool unloadPlugins)
>   {
>   	QErrorMessage *em = new QErrorMessage(this);
> +	QString text = mesg;
> +	QString html = mesg;
>   
>   	if (resize)
>   		_resizeEmpty();
> @@ -1039,8 +1041,11 @@ void KsMainWindow::_error(const QString &text, const QString &errCode,
>   	if (unloadPlugins)
>   		_plugins.unloadAll();
>   
> +	text.replace("<br>", "\n", Qt::CaseInsensitive);
> +	html.replace("\n", "<br>", Qt::CaseInsensitive);
> +
>   	qCritical().noquote() << "ERROR: " << text;
> -	em->showMessage(text, errCode);
> +	em->showMessage(html, errCode);
>   	em->exec();
>   }
>   
> 

All patches look good to me.
Thanks!
Yordan

Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>



  reply	other threads:[~2019-07-17  6:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 13:46 [PATCH 0/4] kernel-shark: The road to 1.0 Steven Rostedt
2019-07-10 13:46 ` [PATCH 1/4] revert: "kernel-shark: Remove a duplicate error message" Steven Rostedt
2019-07-10 13:46 ` [PATCH 2/4] kernel-shark: Remove the "make install" suggestion for capture errors Steven Rostedt
2019-07-10 13:46 ` [PATCH 3/4] kernel-shark: Show the standard error of kshark-record Steven Rostedt
2019-07-10 13:46 ` [PATCH 4/4] kernel-shark: Use <br> for dialog and \n for console error messages Steven Rostedt
2019-07-17  6:55   ` Yordan Karadzhov (VMware) [this message]
2019-07-17  0:24 ` [PATCH 0/4] kernel-shark: The road to 1.0 Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53f66061-89a4-8d81-f618-ef3a7b573517@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).