diff options
author | Peter Wu <peter@lekensteyn.nl> | 2017-06-21 10:58:28 -0400 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2017-06-21 16:39:14 +0000 |
commit | 5503bc6481f3d749e4dd503d4e53710657d37d5e (patch) | |
tree | 0ce2e91b3e6442ca249fa37bca456351880cc976 | |
parent | 6001fc182204c43a0735e16ebe8fdb4b4ea591e4 (diff) | |
download | wireshark-5503bc6481f3d749e4dd503d4e53710657d37d5e.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>
(cherry picked from commit b44ad2a0fa58e4a5acb4293d047993b3aea1f532)
Reviewed-on: https://code.wireshark.org/review/22311
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | ui/qt/capture_file_properties_dialog.cpp | 4 |
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); |