mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-30 22:51:16 +01:00
Code cleanup
This commit is contained in:
parent
ee5b8fa333
commit
27632bf07e
@ -17,7 +17,7 @@ static QString deg2DMS(double val)
|
||||
.arg(sec, 4, 'f', 1, QChar('0'));
|
||||
}
|
||||
|
||||
static QString deg2DM(double val)
|
||||
static QString deg2DMM(double val)
|
||||
{
|
||||
int deg = val;
|
||||
double r1 = val - deg;
|
||||
@ -80,8 +80,8 @@ QString Format::coordinates(const Coordinates &value, CoordinatesFormat type)
|
||||
|
||||
switch (type) {
|
||||
case DegreesMinutes:
|
||||
return deg2DM(qAbs(value.lat())) + yH + "," + QChar(0x00A0)
|
||||
+ deg2DM(qAbs(value.lon())) + xH;
|
||||
return deg2DMM(qAbs(value.lat())) + yH + "," + QChar(0x00A0)
|
||||
+ deg2DMM(qAbs(value.lon())) + xH;
|
||||
break;
|
||||
case DMS:
|
||||
return deg2DMS(qAbs(value.lat())) + yH + "," + QChar(0x00A0)
|
||||
|
@ -1467,10 +1467,10 @@ void GUI::writeSettings()
|
||||
UNITS_DEFAULT)
|
||||
settings.setValue(UNITS_SETTING, _imperialUnitsAction->isChecked()
|
||||
? Imperial : Metric);
|
||||
CoordinatesFormat ct = _DMSAction->isChecked() ? DMS
|
||||
CoordinatesFormat format = _DMSAction->isChecked() ? DMS
|
||||
: _degreesMinutesAction->isChecked() ? DegreesMinutes : DecimalDegrees;
|
||||
if (ct != COORDINATES_DEFAULT)
|
||||
settings.setValue(COORDINATES_SETTING, ct);
|
||||
if (format != COORDINATES_DEFAULT)
|
||||
settings.setValue(COORDINATES_SETTING, format);
|
||||
if (_showToolbarsAction->isChecked() != SHOW_TOOLBARS_DEFAULT)
|
||||
settings.setValue(SHOW_TOOLBARS_SETTING,
|
||||
_showToolbarsAction->isChecked());
|
||||
|
@ -10,14 +10,14 @@
|
||||
#define FS(size) \
|
||||
((int)((qreal)size * 1.41))
|
||||
|
||||
QString WaypointItem::toolTip(Units units, CoordinatesFormat ct)
|
||||
QString WaypointItem::toolTip(Units units, CoordinatesFormat format)
|
||||
{
|
||||
ToolTip tt;
|
||||
|
||||
if (!_waypoint.name().isEmpty())
|
||||
tt.insert(qApp->translate("WaypointItem", "Name"), _waypoint.name());
|
||||
tt.insert(qApp->translate("WaypointItem", "Coordinates"),
|
||||
Format::coordinates(_waypoint.coordinates(), ct));
|
||||
Format::coordinates(_waypoint.coordinates(), format));
|
||||
if (!std::isnan(_waypoint.elevation()))
|
||||
tt.insert(qApp->translate("WaypointItem", "Elevation"),
|
||||
Format::elevation(_waypoint.elevation(), units));
|
||||
@ -124,9 +124,9 @@ void WaypointItem::setColor(const QColor &color)
|
||||
update();
|
||||
}
|
||||
|
||||
void WaypointItem::setToolTipFormat(Units units, CoordinatesFormat ct)
|
||||
void WaypointItem::setToolTipFormat(Units units, CoordinatesFormat format)
|
||||
{
|
||||
setToolTip(toolTip(units, ct));
|
||||
setToolTip(toolTip(units, format));
|
||||
}
|
||||
|
||||
void WaypointItem::showLabel(bool show)
|
||||
|
@ -16,7 +16,7 @@ public:
|
||||
const Waypoint &waypoint() const {return _waypoint;}
|
||||
|
||||
void setMap(Map *map) {setPos(map->ll2xy(_waypoint.coordinates()));}
|
||||
void setToolTipFormat(Units units, CoordinatesFormat ct);
|
||||
void setToolTipFormat(Units units, CoordinatesFormat format);
|
||||
void setSize(int size);
|
||||
void setColor(const QColor &color);
|
||||
void showLabel(bool show);
|
||||
@ -32,7 +32,7 @@ private:
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||
|
||||
void updateShape();
|
||||
QString toolTip(Units units, CoordinatesFormat ct);
|
||||
QString toolTip(Units units, CoordinatesFormat format);
|
||||
|
||||
QPainterPath _shape;
|
||||
Waypoint _waypoint;
|
||||
|
Loading…
Reference in New Issue
Block a user