From 97e53649fd140afa5bb721d87063b7808d8da44f Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Tue, 27 Oct 2015 12:08:57 +0100 Subject: Notes from planned dives contain html. Convert to text for printing. Otherwise we would be printing html source with too many tags for humans to spot the content. [Dirk Hohndel: changed the string comparison to use our helper] Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qthelper.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qthelper.cpp b/qthelper.cpp index 7e4d64ec8..2f1f0416e 100644 --- a/qthelper.cpp +++ b/qthelper.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -216,7 +217,13 @@ void Dive::put_temp() void Dive::put_notes() { - m_notes = QString::fromUtf8(dive->notes); + if (same_string(dive->dc.model, "planned dive")) { + QTextDocument notes; + notes.setHtml(QString::fromUtf8(dive->notes)); + m_notes = notes.toPlainText(); + } else { + m_notes = QString::fromUtf8(dive->notes); + } if (m_notes.isEmpty()) { m_notes = "--"; } -- cgit v1.2.3-70-g09d2