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/map
diff options
context:
space:
mode:
authorLev Dragunov <l.dragunov@corp.mail.ru>2015-07-22 16:17:15 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:58:33 +0300
commitb6526cc5501ffb9f7b9ae5fdc081a2de61236290 (patch)
tree3ee2db2600ce0c5c5a6db324c53ec3ad2bbc2863 /map
parent2f1d252f98d5222cbb6ce6c5d8f2581ede68afb4 (diff)
Move a progress callback initialisation to the framework.
Diffstat (limited to 'map')
-rw-r--r--map/framework.cpp6
-rw-r--r--map/framework.hpp8
2 files changed, 10 insertions, 4 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index 8f4b336348..0ea8c83495 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -2125,7 +2125,7 @@ void Framework::BuildRoute(m2::PointD const & destination, uint32_t timeoutSec)
RemoveRoute();
}
CallRouteBuilded(code, absentCountries, absentRoutingIndexes);
- }, timeoutSec);
+ }, m_progressCallback, timeoutSec);
}
void Framework::SetRouter(RouterType type)
@@ -2176,7 +2176,7 @@ void Framework::SetRouterImpl(RouterType type)
if (type == RouterType::Pedestrian)
{
router =
- CreatePedestrianAStarBidirectionalRouter(m_model.GetIndex(), nullptr, routingVisualizerFn);
+ CreatePedestrianAStarBidirectionalRouter(m_model.GetIndex(), routingVisualizerFn);
m_routingSession.SetRoutingSettings(routing::GetPedestrianRoutingSettings());
}
else
@@ -2259,7 +2259,7 @@ void Framework::CheckLocationForRouting(GpsInfo const & info)
{
if (code == IRouter::NoError)
InsertRoute(route);
- }, 0 /* timeoutSec */);
+ }, m_progressCallback, 0 /* timeoutSec */);
}
}
diff --git a/map/framework.hpp b/map/framework.hpp
index 13e5898b25..f4d1d7127c 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -564,7 +564,12 @@ public:
void BuildRoute(m2::PointD const & destination, uint32_t timeoutSec);
typedef function<void(routing::IRouter::ResultCode, vector<storage::TIndex> const &,
vector<storage::TIndex> const &)> TRouteBuildingCallback;
- void SetRouteBuildingListener(TRouteBuildingCallback const & callback) { m_routingCallback = callback; }
+ typedef function<void(float)> TRouteProgressCallback;
+ void SetRouteBuildingListener(TRouteBuildingCallback const & buildingCallback, TRouteProgressCallback const & progressCallback)
+ {
+ m_routingCallback = buildingCallback;
+ m_progressCallback = progressCallback;
+ }
void FollowRoute() { GetLocationState()->StartRouteFollow(); }
void CloseRouting();
void GetRouteFollowingInfo(location::FollowingInfo & info) { m_routingSession.GetRouteFollowingInfo(info); }
@@ -597,6 +602,7 @@ private:
string GetRoutingErrorMessage(routing::IRouter::ResultCode code);
TRouteBuildingCallback m_routingCallback;
+ TRouteProgressCallback m_progressCallback;
routing::RouterType m_currentRouterType;
//@}