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>
This commit is contained in:
Robert C. Helling 2015-10-27 12:08:57 +01:00 committed by Dirk Hohndel
parent dfc1e36c0e
commit 97e53649fd

View file

@ -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 = "--";
}