summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/maintab.cpp26
-rw-r--r--qt-ui/maintab.h1
-rw-r--r--qthelper.cpp35
-rw-r--r--qthelper.h2
4 files changed, 31 insertions, 33 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 234a01c43..172e4e2d7 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1076,32 +1076,6 @@ void MainTab::editWeightWidget(const QModelIndex &index)
ui.weights->edit(index);
}
-QString MainTab::printGPSCoords(int lat, int lon)
-{
- unsigned int latdeg, londeg;
- unsigned int latmin, lonmin;
- double latsec, lonsec;
- QString lath, lonh, result;
-
- if (!lat && !lon)
- return QString("");
-
- lath = lat >= 0 ? tr("N") : tr("S");
- lonh = lon >= 0 ? tr("E") : tr("W");
- lat = abs(lat);
- lon = abs(lon);
- latdeg = lat / 1000000;
- londeg = lon / 1000000;
- latmin = (lat % 1000000) * 60;
- lonmin = (lon % 1000000) * 60;
- latsec = (latmin % 1000000) * 60;
- lonsec = (lonmin % 1000000) * 60;
- result.sprintf("%u%s%02d\'%06.3f\"%s %u%s%02d\'%06.3f\"%s",
- latdeg, UTF8_DEGREE, latmin / 1000000, latsec / 1000000, lath.toUtf8().data(),
- londeg, UTF8_DEGREE, lonmin / 1000000, lonsec / 1000000, lonh.toUtf8().data());
- return result;
-}
-
void MainTab::updateCoordinatesText(qreal lat, qreal lon)
{
int ulat = rint(lat * 1000000);
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index ece2c4009..d201d2a47 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -120,7 +120,6 @@ private:
Completers completers;
void resetPallete();
void saveTags();
- QString printGPSCoords(int lat, int lon);
void updateGpsCoordinates(const struct dive *dive);
};
diff --git a/qthelper.cpp b/qthelper.cpp
index a5e450eff..f056f5238 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -110,6 +110,32 @@ QString weight_string(int weight_in_grams)
return (str);
}
+QString printGPSCoords(int lat, int lon)
+{
+ unsigned int latdeg, londeg;
+ unsigned int latmin, lonmin;
+ double latsec, lonsec;
+ QString lath, lonh, result;
+
+ if (!lat && !lon)
+ return QString();
+
+ lath = lat >= 0 ? tr("N") : tr("S");
+ lonh = lon >= 0 ? tr("E") : tr("W");
+ lat = abs(lat);
+ lon = abs(lon);
+ latdeg = lat / 1000000;
+ londeg = lon / 1000000;
+ latmin = (lat % 1000000) * 60;
+ lonmin = (lon % 1000000) * 60;
+ latsec = (latmin % 1000000) * 60;
+ lonsec = (lonmin % 1000000) * 60;
+ result.sprintf("%u%s%02d\'%06.3f\"%s %u%s%02d\'%06.3f\"%s",
+ latdeg, UTF8_DEGREE, latmin / 1000000, latsec / 1000000, lath.toUtf8().data(),
+ londeg, UTF8_DEGREE, lonmin / 1000000, lonsec / 1000000, lonh.toUtf8().data());
+ return result;
+}
+
bool parseGpsText(const QString &gps_text, double *latitude, double *longitude)
{
enum {
@@ -121,10 +147,10 @@ bool parseGpsText(const QString &gps_text, double *latitude, double *longitude)
int eastWest = 4;
int northSouth = 1;
QString trHemisphere[4];
- trHemisphere[0] = MainWindow::instance()->information()->trHemisphere("N");
- trHemisphere[1] = MainWindow::instance()->information()->trHemisphere("S");
- trHemisphere[2] = MainWindow::instance()->information()->trHemisphere("E");
- trHemisphere[3] = MainWindow::instance()->information()->trHemisphere("W");
+ trHemisphere[0] = tr("N");
+ trHemisphere[1] = tr("S");
+ trHemisphere[2] = tr("E");
+ trHemisphere[3] = tr("W");
QString regExp;
/* an empty string is interpreted as 0.0,0.0 and therefore "no gps location" */
if (gps_text.trimmed().isEmpty()) {
@@ -302,7 +328,6 @@ extern "C" void call_for_each_dc(void *f, void (*callback)(void *, const char *,
}
}
-
static xmlDocPtr get_stylesheet_doc(const xmlChar *uri, xmlDictPtr, int, void *, xsltLoadType)
{
QFile f(QLatin1String(":/xslt/") + (const char *)uri);
diff --git a/qthelper.h b/qthelper.h
index 9d31f5a12..6067e1359 100644
--- a/qthelper.h
+++ b/qthelper.h
@@ -41,6 +41,6 @@ public:
QString weight_string(int weight_in_grams);
bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_text, bool *parsed);
-
+QString printGPSCoords(int lat, int lon);
QList<int> getDivesInTrip(dive_trip_t *trip);
#endif // QTHELPER_H