mapwidgethelper: add the method copyToClipboardCoordinates()

This method uses the helper printGPSCoords() to format the
coordinates of a location into either decimal or sexagesimal.
The selection is handled by the boolean flag "formatTraditional"
and the user preferences flag - prefs.coordinates_traditional.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-07-21 17:31:58 +03:00 committed by Dirk Hohndel
parent 621dd53a43
commit 3624d30354
2 changed files with 21 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include <QObject>
class QGeoCoordinate;
class MapLocationModel;
class MapLocation;
struct dive_site;
@ -19,6 +20,7 @@ public:
void centerOnDiveSite(struct dive_site *);
void reloadMapLocations();
Q_INVOKABLE void copyToClipboardCoordinates(QGeoCoordinate coord, bool formatTraditional);
private:
QObject *m_map;
@ -31,4 +33,6 @@ signals:
void modelChanged();
};
extern "C" const char *printGPSCoords(int lat, int lon);
#endif