summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-06-21 10:58:28 -0400
committerAnders Broman <a.broman58@gmail.com>2017-06-21 16:14:00 +0000
commitb44ad2a0fa58e4a5acb4293d047993b3aea1f532 (patch)
treef78bd987a9ad4107ab5f3b459a66f02d7a265c69 /ui
parent48a6487116e607417acbfcd98a6f883bfd9d36be (diff)
downloadwireshark-b44ad2a0fa58e4a5acb4293d047993b3aea1f532.tar.gz
Qt: display newlines in capture file comments
Due to the use of HTML, whitespace (including newline) are shown as single horizontal space. Add a special case for newlines. Bug: 13819 Change-Id: Iefa2af7d2948ed18a3b7f8f4ee8cb90100bf3460 Reviewed-on: https://code.wireshark.org/review/22306 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/capture_file_properties_dialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index dd53edfd32..1f18bdf6a1 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -516,7 +516,7 @@ void CaptureFilePropertiesDialog::fillDetails()
if (!file_comments.isEmpty()) {
QString file_comments_html;
- QString comment_escaped = html_escape(file_comments);
+ QString comment_escaped = html_escape(file_comments).replace('\n', "<br>");
file_comments_html = section_tmpl_.arg(tr("File Comment"));
file_comments_html += para_tmpl_.arg(comment_escaped);
@@ -536,7 +536,7 @@ void CaptureFilePropertiesDialog::fillDetails()
QString frame_comment_html = tr("<p>Frame %1: ").arg(framenum);
QString raw_comment = pkt_comment;
- frame_comment_html += html_escape(raw_comment);
+ frame_comment_html += html_escape(raw_comment).replace('\n', "<br>");
frame_comment_html += "</p>\n";
cursor.insertBlock();
cursor.insertHtml(frame_comment_html);