From 23462e039502f5168f52fd6fb7fd39355526a55a Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Fri, 3 Jul 2015 13:58:21 +0300 Subject: [PATCH] [omim] Removed yards. --- map/ruler.cpp | 26 -------------------------- platform/measurement_utils.cpp | 3 --- platform/measurement_utils.hpp | 3 --- platform/settings.cpp | 3 --- platform/settings.hpp | 2 +- qt/preferences_dialog.cpp | 7 +------ 6 files changed, 2 insertions(+), 42 deletions(-) diff --git a/map/ruler.cpp b/map/ruler.cpp index fe8a50da0d..7704db5a25 100644 --- a/map/ruler.cpp +++ b/map/ruler.cpp @@ -64,23 +64,6 @@ namespace { "500 mi", 500 * 5280 } }; - UnitValue g_arrYards[] = { - { "50 yd", 50 }, - { "100 yd", 100 }, - { "200 yd", 200 }, - { "500 yd", 500 }, - { "0.5 mi", 1760 / 2 }, - { "1 mi", 1760 }, - { "2 mi", 2 * 1760 }, - { "5 mi", 5 * 1760 }, - { "10 mi", 10 * 1760 }, - { "20 mi", 20 * 1760 }, - { "50 mi", 50 * 1760 }, - { "100 mi", 100 * 1760 }, - { "200 mi", 200 * 1760 }, - { "500 mi", 500 * 1760 } - }; - UnitValue g_arrMetres[] = { { "1 m", 1 }, { "2 m", 2 }, @@ -398,12 +381,6 @@ double Ruler::CalcMetresDiff(double value) count = ARRAY_SIZE(g_arrFeets); conversionFn = &MeasurementUtils::MetersToFeet; break; - - case 2: - arrU = g_arrYards; - count = ARRAY_SIZE(g_arrYards); - conversionFn = &MeasurementUtils::MetersToYards; - break; } int prevUnitRange = m_currentRangeIndex; @@ -493,9 +470,6 @@ void Ruler::layout() case Settings::Foot: m_currSystem = 1; break; - case Settings::Yard: - m_currSystem = 2; - break; } if (prevCurrSystem != m_currSystem) diff --git a/platform/measurement_utils.cpp b/platform/measurement_utils.cpp index c5111fcfee..c0b1cfb52e 100644 --- a/platform/measurement_utils.cpp +++ b/platform/measurement_utils.cpp @@ -54,7 +54,6 @@ bool FormatDistance(double m, string & res) /// @todo Put string units resources. switch (u) { - case Yard: return FormatDistanceImpl(m, res, " mi", " yd", 1609.344, 0.9144); case Foot: return FormatDistanceImpl(m, res, " mi", " ft", 1609.344, 0.3048); default: return FormatDistanceImpl(m, res, " km", " m", 1000.0, 1.0); } @@ -161,7 +160,6 @@ string FormatAltitude(double altitudeInMeters) /// @todo Put string units resources. switch (u) { - case Yard: ss << MetersToYards(altitudeInMeters) << "yd"; break; case Foot: ss << MetersToFeet(altitudeInMeters) << "ft"; break; default: ss << altitudeInMeters << "m"; break; } @@ -179,7 +177,6 @@ string FormatSpeed(double metersPerSecond) /// @todo Put string units resources. switch (u) { - case Yard: case Foot: perHour = metersPerSecond * 3600. / 1609.344; res = ToStringPrecision(perHour, perHour >= 10.0 ? 0 : 1) + "mph"; diff --git a/platform/measurement_utils.hpp b/platform/measurement_utils.hpp index 8d2961dba7..0fe8c4c257 100644 --- a/platform/measurement_utils.hpp +++ b/platform/measurement_utils.hpp @@ -9,12 +9,9 @@ namespace MeasurementUtils inline double MetersToMiles(double m) { return m * 0.000621371192; } inline double MilesToMeters(double mi) { return mi * 1609.344; } -inline double MetersToYards(double m) { return m * 1.0936133; } -inline double YardsToMeters(double yd) { return yd * 0.9144; } inline double MetersToFeet(double m) { return m * 3.2808399; } inline double FeetToMeters(double ft) { return ft * 0.3048; } inline double FeetToMiles(double ft) { return ft * 5280; } -inline double YardToMiles(double yd) { return yd * 1760; } /// Takes into an account user settings [metric, imperial] /// @param[in] m meters diff --git a/platform/settings.cpp b/platform/settings.cpp index bcd059a5dc..f85bfc9bda 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -319,7 +319,6 @@ namespace Settings { switch (v) { - case Yard: return "Yard"; case Foot: return "Foot"; default: return "Metric"; } @@ -329,8 +328,6 @@ namespace Settings { if (s == "Metric") v = Metric; - else if (s == "Yard") - v = Yard; else if (s == "Foot") v = Foot; else diff --git a/platform/settings.hpp b/platform/settings.hpp index 1da268e6da..a6852b2a53 100644 --- a/platform/settings.hpp +++ b/platform/settings.hpp @@ -46,7 +46,7 @@ namespace Settings StringStorage::Instance().DeleteKeyAndValue(key); } - enum Units { Metric = 0, Yard, Foot }; + enum Units { Metric = 0, Foot }; /// Use this function for running some stuff once according to date. /// @param[in] date Current date in format yymmdd. diff --git a/qt/preferences_dialog.cpp b/qt/preferences_dialog.cpp index c375514c5f..622f4f377e 100644 --- a/qt/preferences_dialog.cpp +++ b/qt/preferences_dialog.cpp @@ -46,10 +46,6 @@ namespace qt pLayout->addWidget(p); m_pUnits->addButton(p, Metric); - p = new QRadioButton("Imperial (yard)"); - pLayout->addWidget(p); - m_pUnits->addButton(p, Yard); - p = new QRadioButton("Imperial (foot)"); pLayout->addWidget(p); m_pUnits->addButton(p, Foot); @@ -102,8 +98,7 @@ namespace qt switch (i) { case 0: u = Metric; break; - case 1: u = Yard; break; - case 2: u = Foot; break; + case 1: u = Foot; break; } Settings::Set("Units", u);