diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-10-27 12:08:57 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-28 07:50:38 +0900 |
commit | 97e53649fd140afa5bb721d87063b7808d8da44f (patch) | |
tree | d99b0960df0dfdb68aca258f290fba381e8ed4c1 | |
parent | dfc1e36c0e6c4486fcb2db6bdafe4046de594e5e (diff) | |
download | subsurface-97e53649fd140afa5bb721d87063b7808d8da44f.tar.gz |
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 <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qthelper.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qthelper.cpp b/qthelper.cpp index 7e4d64ec8..2f1f0416e 100644 --- a/qthelper.cpp +++ b/qthelper.cpp @@ -28,6 +28,7 @@ #include <QtConcurrent> #include <QFont> #include <QApplication> +#include <QTextDocument> #include <libxslt/documents.h> @@ -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 = "--"; } |