summaryrefslogtreecommitdiffstats
path: root/templatelayout.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-08-09 01:12:15 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-08-15 15:02:59 +0300
commit06e2fab291295f377af19fcc6f4d7415477c0f44 (patch)
tree636f1ad194bf3ee0336a26a716b0efdc6bdc88d3 /templatelayout.cpp
parentd72ba4f15a2616888a777bf2b70c7df639979f31 (diff)
downloadsubsurface-06e2fab291295f377af19fcc6f4d7415477c0f44.tar.gz
Printing: insert placeholders in empty feilds
Don't leave fields empty, this may corrupt the layout, a better way is to insert placeholders for empty data, which also provides a better UX. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Diffstat (limited to 'templatelayout.cpp')
-rw-r--r--templatelayout.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/templatelayout.cpp b/templatelayout.cpp
index 437a6aea6..b0098fbd9 100644
--- a/templatelayout.cpp
+++ b/templatelayout.cpp
@@ -211,7 +211,7 @@ int Dive::rating() const
void Dive::put_divemaster()
{
if (!dive->divemaster)
- m_divemaster = "";
+ m_divemaster = "--";
else
m_divemaster = dive->divemaster;
}
@@ -227,6 +227,9 @@ void Dive::put_date_time()
void Dive::put_location()
{
m_location = QString::fromUtf8(get_dive_location(dive));
+ if (m_location.isEmpty()) {
+ m_location = "--";
+ }
}
void Dive::put_depth()
@@ -242,7 +245,7 @@ void Dive::put_duration()
void Dive::put_buddy()
{
if (!dive->buddy)
- m_buddy = "";
+ m_buddy = "--";
else
m_buddy = dive->buddy;
}
@@ -251,11 +254,20 @@ void Dive::put_temp()
{
m_airTemp = get_temperature_string(dive->airtemp, true);
m_waterTemp = get_temperature_string(dive->watertemp, true);
+ if (m_airTemp.isEmpty()) {
+ m_airTemp = "--";
+ }
+ if (m_waterTemp.isEmpty()) {
+ m_waterTemp = "--";
+ }
}
void Dive::put_notes()
{
m_notes = QString::fromUtf8(dive->notes);
+ if (m_notes.isEmpty()) {
+ m_notes = "--";
+ }
}
void Dive::put_tags()