mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
formatting: move get_trip_title to string-format.h and split it
To enable grouping by trip in the statistics module, split the get_trip_title() function in a version that appends a "(n dive(s)" string an one that doesn't. The statistics module doesn't want that added string, since it displays the number of dives in a different way. Also, move the functions to string-format.h, where these are collected. And rename them to camelCase. Yes, it's ugly, but consistent with most other C++ code in the code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
5d1f12438b
commit
d1b8f1ca3d
6 changed files with 35 additions and 25 deletions
|
|
@ -3,11 +3,11 @@
|
|||
#include "core/divefilter.h"
|
||||
#ifdef SUBSURFACE_MOBILE
|
||||
#include "qt-models/mobilelistmodel.h"
|
||||
#include "core/string-format.h"
|
||||
#endif
|
||||
#include "core/gettextfromc.h"
|
||||
#include "core/metrics.h"
|
||||
#include "core/selection.h"
|
||||
#include "core/string-format.h"
|
||||
#include "core/trip.h"
|
||||
#include "core/qthelper.h"
|
||||
#include "core/divesite.h"
|
||||
|
|
@ -123,7 +123,7 @@ QVariant DiveTripModelBase::tripData(const dive_trip *trip, int column, int role
|
|||
int countShown = trip_shown_dives(trip);
|
||||
if (countShown < trip->dives.nr)
|
||||
shownText = tr("(%1 shown)").arg(countShown);
|
||||
return get_trip_string(trip) + " " + shownText;
|
||||
return formatTripTitleWithDives(trip) + " " + shownText;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue