From b7806d1b945851a6a1713e7d619e1b3f4ddee464 Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Tue, 28 Nov 2017 18:10:37 +0100 Subject: Correctly handle dive notes in maintab.cpp Remove duplicate and incorrect setPlainText call via macro for dive notes. Deal correctly with ASCII line breaks "\n" in dive notes with html markup (replace them with
). Signed-off-by: Stefan Fuchs --- desktop-widgets/tab-widgets/maintab.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 3a2b3af89..0a57fd4e8 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -426,12 +426,13 @@ void MainTab::updateDiveInfo(bool clear) ui.notes->setText(QString()); if (!clear) { QString tmp(displayed_dive.notes); - if (tmp.indexOf("")); ui.notes->setHtml(tmp); - else + } else { ui.notes->setPlainText(tmp); + } } - UPDATE_TEXT(displayed_dive, notes); UPDATE_TEXT(displayed_dive, suit); UPDATE_TEXT(displayed_dive, divemaster); UPDATE_TEXT(displayed_dive, buddy); @@ -1494,10 +1495,12 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what) SHOW_SELECTIVE(suit); if (what.notes) { QString tmp(displayed_dive.notes); - if (tmp.contains("")); ui.notes->setHtml(tmp); - else + } else { ui.notes->setPlainText(tmp); + } } if (what.rating) ui.rating->setCurrentStars(displayed_dive.rating); -- cgit v1.2.3-70-g09d2