Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qt
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-04-18 16:26:02 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-04-18 18:01:58 +0300
commit73c4caa9cb102f54397134fc608eb5833c00c326 (patch)
treea3b9b6b816fb8894a8f8fbb0297dc7c20d871bd9 /qt
parent94a1e367f134d9463ce3b15cc7948ece4395fb84 (diff)
[bicycle routing] Review fixes.
Diffstat (limited to 'qt')
-rw-r--r--qt/search_panel.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp
index 94cef9dce4..f0d8ee2267 100644
--- a/qt/search_panel.cpp
+++ b/qt/search_panel.cpp
@@ -175,21 +175,19 @@ bool SearchPanel::TryChangeMapStyleCmd(QString const & str)
// TODO: This code only for demonstration purposes and will be removed soon
bool SearchPanel::TryChangeRouterCmd(QString const & str)
{
- bool const isPedestrian = (str == "?pedestrian");
- bool const isVehicle = isPedestrian ? false : (str == "?vehicle");
- bool const isBicycle = isPedestrian || isVehicle ? false : (str == "?bicycle");
-
- if (!isPedestrian && !isVehicle && !isBicycle)
+ routing::RouterType routerType;
+ if (str == "?pedestrian")
+ routerType = routing::RouterType::Pedestrian;
+ else if (str == "?vehicle")
+ routerType = routing::RouterType::Vehicle;
+ else if (str == "?bicycle")
+ routerType = routing::RouterType::Bicycle;
+ else
return false;
m_pEditor->setText("");
parentWidget()->hide();
-
- routing::RouterType const routerType = isPedestrian ? routing::RouterType::Pedestrian :
- isVehicle ? routing::RouterType::Vehicle :
- routing::RouterType::Bicycle;
m_pDrawWidget->SetRouter(routerType);
-
return true;
}