cleanup: move minute formating to format-string.cpp

The get_minutes() function formats a time as m:ss
and returns a static C-string. Since all callers are
C++ anyway and transform directly into QString, let us
move this to the other string formatting function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-03 10:37:58 +02:00 committed by Dirk Hohndel
parent 1047937197
commit 4a7ee872f3
7 changed files with 17 additions and 18 deletions

View file

@ -464,11 +464,11 @@ QVariant TemplateLayout::getValue(QString list, QString property, const State &s
return get_dive_duration_string(object->total_time.seconds, gettextFromC::tr("h"),
gettextFromC::tr("min"), gettextFromC::tr("sec"), " ");
} else if (property == "avg_time") {
return get_minutes(object->total_time.seconds / object->selection_size);
return formatMinutes(object->total_time.seconds / object->selection_size);
} else if (property == "shortest_time") {
return get_minutes(object->shortest_time.seconds);
return formatMinutes(object->shortest_time.seconds);
} else if (property == "longest_time") {
return get_minutes(object->longest_time.seconds);
return formatMinutes(object->longest_time.seconds);
} else if (property == "avg_depth") {
return get_depth_string(object->avg_depth);
} else if (property == "min_depth") {