From bbbd4c88180d43604c5e6bbe093461e93859d706 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 28 Dec 2020 14:30:57 +0100 Subject: cleanup: remove getDivesInTrip() in qthelper.cpp This function was not used anywhere. Moreover, remove a few unused includes from qthelper.h. Surprisingly, a number of users of qthelper.h depend on these, so readd them at the appropriate places. Signed-off-by: Berthold Stoeger --- core/metadata.cpp | 1 + core/qt-init.cpp | 1 + core/qthelper.cpp | 13 ------------- core/qthelper.h | 5 +---- desktop-widgets/preferences/preferences_language.cpp | 2 +- desktop-widgets/templatelayout.cpp | 2 ++ qt-models/models.cpp | 1 + 7 files changed, 7 insertions(+), 18 deletions(-) diff --git a/core/metadata.cpp b/core/metadata.cpp index bca750b73..9c7a06116 100644 --- a/core/metadata.cpp +++ b/core/metadata.cpp @@ -5,6 +5,7 @@ #include "qthelper.h" #include #include +#include #include // Weirdly, android builds fail owing to undefined UINT64_MAX diff --git a/core/qt-init.cpp b/core/qt-init.cpp index ef8af3337..faec198f9 100644 --- a/core/qt-init.cpp +++ b/core/qt-init.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "qthelper.h" #include "errorhelper.h" #include "core/settings/qPref.h" diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 2e74c5625..4db43458b 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -290,19 +290,6 @@ bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_te } #endif -QList getDivesInTrip(dive_trip_t *trip) -{ - QList ret; - int i; - struct dive *d; - for_each_dive (i, d) { - if (d->divetrip == trip) { - ret.push_back(get_divenr(d)); - } - } - return ret; -} - static xmlDocPtr get_stylesheet_doc(const xmlChar *uri, xmlDictPtr, int, void *, xsltLoadType) { QFile f(QLatin1String(":/xslt/") + (const char *)uri); diff --git a/core/qthelper.h b/core/qthelper.h index c53b185a2..c0457256b 100644 --- a/core/qthelper.h +++ b/core/qthelper.h @@ -19,15 +19,12 @@ enum watertypes {FRESHWATER, BRACKISHWATER, EN13319WATER, SALTWATER, DC_WATERTYP #ifdef __cplusplus -#include #include -#include -#include #include "core/gettextfromc.h" + QString weight_string(int weight_in_grams); QString distance_string(int distanceInMeters); bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_text, bool *parsed_out = 0); -QList getDivesInTrip(struct dive_trip *trip); QString get_gas_string(struct gasmix gas); QString get_taglist_string(struct tag_entry *tag_list); QStringList stringToList(const QString &s); diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp index f2519ef2c..46e65722d 100644 --- a/desktop-widgets/preferences/preferences_language.cpp +++ b/desktop-widgets/preferences/preferences_language.cpp @@ -4,7 +4,7 @@ #include "core/qthelper.h" #include "core/settings/qPrefLanguage.h" -#include +#include #include #include diff --git a/desktop-widgets/templatelayout.cpp b/desktop-widgets/templatelayout.cpp index 94cf322f0..f1454ac6e 100644 --- a/desktop-widgets/templatelayout.cpp +++ b/desktop-widgets/templatelayout.cpp @@ -1,4 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 +#include +#include #include #include #include diff --git a/qt-models/models.cpp b/qt-models/models.cpp index 7be9c2440..70f95abc1 100644 --- a/qt-models/models.cpp +++ b/qt-models/models.cpp @@ -10,6 +10,7 @@ #include "core/dive.h" #include "core/gettextfromc.h" +#include #include Qt::ItemFlags GasSelectionModel::flags(const QModelIndex&) const -- cgit v1.2.3-70-g09d2