diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-10 09:42:48 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-18 17:04:26 -0400 |
commit | 4ff3880c7f63c176ef1fcfeb97f5e3a103890bab (patch) | |
tree | a52ad8f7fa542989da3638c284760fcb9d5dc4f6 | |
parent | 8adfaa167000ab4e5c83cdc7e6f87861b766b93b (diff) | |
download | trace-cmd-4ff3880c7f63c176ef1fcfeb97f5e3a103890bab.tar.gz |
kernel-shark: Use '<br>' for dialog and '\n' for console error messages
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.
Link: http://lkml.kernel.org/r/20190710134725.599995325@goodmis.org
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | kernel-shark/src/KsMainWindow.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 54aa6d78..29d44d9a 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(); } |