summaryrefslogtreecommitdiffstats
path: root/core/divelogexportlogic.cpp
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-05-11 22:43:36 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-26 15:50:52 -0700
commite6d884cf26161df65c2b4b8c39d6b4133760537b (patch)
tree2b9132e7d057c514c852a7cf7bed39fa67455a6f /core/divelogexportlogic.cpp
parent53a8075bd8d7231f2bb483b9adca0fc60d4446f1 (diff)
downloadsubsurface-e6d884cf26161df65c2b4b8c39d6b4133760537b.tar.gz
Creation of dive duration string and surface interval string
Update the function to create the dive duration string in a way that it can be used also in info and stats tab and added some more flexibility. Changed layout for <1h freedives to "0:05:35" (w/o units) or "5:35min" (with units and :) or "5min 35sec" (with units with space). Add a new function to create the surface interval string. Completely remove old function get_time_string() and get_time_string_s(). Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'core/divelogexportlogic.cpp')
-rw-r--r--core/divelogexportlogic.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/divelogexportlogic.cpp b/core/divelogexportlogic.cpp
index e904b85e6..926dd461c 100644
--- a/core/divelogexportlogic.cpp
+++ b/core/divelogexportlogic.cpp
@@ -52,7 +52,8 @@ static void exportHTMLstatisticsTotal(QTextStream &out, stats_t *total_stats)
out << "{";
out << "\"YEAR\":\"Total\",";
out << "\"DIVES\":\"" << total_stats->selection_size << "\",";
- out << "\"TOTAL_TIME\":\"" << get_time_string(total_stats->total_time.seconds, 0) << "\",";
+ out << "\"TOTAL_TIME\":\"" << get_dive_duration_string(total_stats->total_time.seconds,
+ QObject::tr("h"), QObject::tr("min"), QObject::tr("sec"), " ") << "\",";
out << "\"AVERAGE_TIME\":\"--\",";
out << "\"SHORTEST_TIME\":\"--\",";
out << "\"LONGEST_TIME\":\"--\",";
@@ -87,7 +88,8 @@ static void exportHTMLstatistics(const QString filename, struct htmlExportSettin
out << "{";
out << "\"YEAR\":\"" << stats_yearly[i].period << "\",";
out << "\"DIVES\":\"" << stats_yearly[i].selection_size << "\",";
- out << "\"TOTAL_TIME\":\"" << get_time_string(stats_yearly[i].total_time.seconds, 0) << "\",";
+ out << "\"TOTAL_TIME\":\"" << get_dive_duration_string(stats_yearly[i].total_time.seconds,
+ QObject::tr("h"), QObject::tr("min"), QObject::tr("sec"), " ") << "\",";
out << "\"AVERAGE_TIME\":\"" << get_minutes(stats_yearly[i].total_time.seconds / stats_yearly[i].selection_size) << "\",";
out << "\"SHORTEST_TIME\":\"" << get_minutes(stats_yearly[i].shortest_time.seconds) << "\",";
out << "\"LONGEST_TIME\":\"" << get_minutes(stats_yearly[i].longest_time.seconds) << "\",";