diff options
author | ygorshenin <mipt.vi002@gmail.com> | 2016-04-18 18:14:53 +0300 |
---|---|---|
committer | ygorshenin <mipt.vi002@gmail.com> | 2016-04-18 18:14:53 +0300 |
commit | c37876602f08876c566bacff4ff855c4752219bd (patch) | |
tree | 9118c242ac48be6de0b8d48780546cd577616d3d /qt | |
parent | a5eb92b8eb76f405a4da181dd3962eca74974b80 (diff) | |
parent | 73c4caa9cb102f54397134fc608eb5833c00c326 (diff) |
Merge pull request #2908 from bykoianko/master-bicycle-profile
Bicycle routing profile.
Diffstat (limited to 'qt')
-rw-r--r-- | qt/search_panel.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp index 347c65c853..f0d8ee2267 100644 --- a/qt/search_panel.cpp +++ b/qt/search_panel.cpp @@ -175,18 +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"); - - if (!isPedestrian && !isVehicle) + 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 : routing::RouterType::Vehicle; m_pDrawWidget->SetRouter(routerType); - return true; } |