model: unify tooltip formating in DiveTripModel

The formatting of the tooltips describing the columns
was repeated in two functions. Infuriatingly, there were
to minor differences: "Max. CNS" vs. "Max CNS" and
one version understood "Country".

Break that out into a single function to avoid these
inconsistencies and to save a few lines of code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-02-12 14:43:04 +01:00 committed by Dirk Hohndel
parent b3c58e7172
commit 1ce42158f1
2 changed files with 52 additions and 84 deletions

View file

@ -95,6 +95,7 @@ protected:
static QVariant tripData(const dive_trip *trip, int column, int role);
static QString tripTitle(const dive_trip *trip);
static QString tripShortDate(const dive_trip *trip);
static QString getDescription(int column);
void currentChanged();
virtual dive *diveOrNull(const QModelIndex &index) const = 0; // Returns a dive if this index represents a dive, null otherwise