From 85255b3c052e5e72ee079f03a08cdf117bb46c7a Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Mon, 18 May 2015 13:26:57 +0300 Subject: [PATCH] Review fixes --- map/framework.cpp | 32 ++++++++++++++------------------ map/framework.hpp | 4 ---- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/map/framework.cpp b/map/framework.cpp index 0604788130..7ab3ea3d95 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -863,31 +863,16 @@ void Framework::OnDownloadMapCallback(storage::TIndex const & countryIndex) m_activeMaps->DownloadMap(countryIndex, TMapOptions::EMapOnly); } -void Framework::OnDownloadMapCallbackUI(storage::TIndex const & countryIndex) -{ - GetPlatform().RunOnGuiThread(bind(&Framework::OnDownloadMapCallback, this, countryIndex)); -} - void Framework::OnDownloadMapRoutingCallback(storage::TIndex const & countryIndex) { m_activeMaps->DownloadMap(countryIndex, TMapOptions::EMapWithCarRouting); } -void Framework::OnDownloadMapRoutingCallbackUI(storage::TIndex const & countryIndex) -{ - GetPlatform().RunOnGuiThread(bind(&Framework::OnDownloadMapRoutingCallback, this, countryIndex)); -} - void Framework::OnDownloadRetryCallback(storage::TIndex const & countryIndex) { m_activeMaps->RetryDownloading(countryIndex); } -void Framework::OnDownloadRetryCallbackUI(storage::TIndex const & countryIndex) -{ - GetPlatform().RunOnGuiThread(bind(&Framework::OnDownloadRetryCallback, this, countryIndex)); -} - void Framework::MemoryWarning() { LOG(LINFO, ("MemoryWarning")); @@ -1322,9 +1307,20 @@ void Framework::CreateDrapeEngine(ref_ptr contextFactory, TIsCountryLoadedFn isCountryLoadedFn = bind(&Framework::IsCountryLoaded, this, _1); - TDownloadFn downloadMapFn = bind(&Framework::OnDownloadMapCallbackUI, this, _1); - TDownloadFn downloadMapRoutingFn = bind(&Framework::OnDownloadMapRoutingCallbackUI, this, _1); - TDownloadFn downloadRetryFn = bind(&Framework::OnDownloadRetryCallbackUI, this, _1); + TDownloadFn downloadMapFn = [this](storage::TIndex const & countryIndex) + { + GetPlatform().RunOnGuiThread(bind(&Framework::OnDownloadMapCallback, this, countryIndex)); + }; + + TDownloadFn downloadMapRoutingFn = [this](storage::TIndex const & countryIndex) + { + GetPlatform().RunOnGuiThread(bind(&Framework::OnDownloadMapRoutingCallback, this, countryIndex)); + }; + + TDownloadFn downloadRetryFn = [this](storage::TIndex const & countryIndex) + { + GetPlatform().RunOnGuiThread(bind(&Framework::OnDownloadRetryCallback, this, countryIndex)); + }; df::DrapeEngine::Params p(contextFactory, make_ref(&m_stringsBundle), diff --git a/map/framework.hpp b/map/framework.hpp index 7d88f4aa75..b0258c396a 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -298,13 +298,9 @@ private: void FillSearchResultsMarks(search::Results const & results); - void OnDownloadMapCallback(storage::TIndex const & countryIndex); - void OnDownloadMapCallbackUI(storage::TIndex const & countryIndex); void OnDownloadMapRoutingCallback(storage::TIndex const & countryIndex); - void OnDownloadMapRoutingCallbackUI(storage::TIndex const & countryIndex); void OnDownloadRetryCallback(storage::TIndex const & countryIndex); - void OnDownloadRetryCallbackUI(storage::TIndex const & countryIndex); public: using TSearchRequest = search::QuerySaver::TSearchRequest;