Merge pull request #3796 from ygorshenin/honor-original-on-results

[search] Honor original onResults callback.
This commit is contained in:
Илья Гречухин 2016-07-15 17:25:57 +04:00 committed by GitHub
commit 087fd6db99
2 changed files with 10 additions and 5 deletions

View file

@ -1067,20 +1067,23 @@ void Framework::StartInteractiveSearch(search::SearchParams const & params)
{
using namespace search;
auto const originalOnResults = params.m_onResults;
m_lastInteractiveSearchParams = params;
m_lastInteractiveSearchParams.SetForceSearch(false);
m_lastInteractiveSearchParams.SetMode(search::Mode::Viewport);
m_lastInteractiveSearchParams.SetSuggestsEnabled(false);
m_lastInteractiveSearchParams.m_onResults = [this](Results const & results)
{
m_lastInteractiveSearchParams.m_onResults = [this, originalOnResults](Results const & results) {
if (!results.IsEndMarker())
{
GetPlatform().RunOnGuiThread([this, results]()
{
GetPlatform().RunOnGuiThread([this, results]() {
if (IsInteractiveSearchActive())
FillSearchResultsMarks(results);
});
}
if (originalOnResults)
originalOnResults(results);
};
UpdateUserViewportChanged();
}

View file

@ -8,7 +8,9 @@
namespace search
{
SearchParams::SearchParams()
: m_searchRadiusM(-1.0)
: m_lat(0.0)
, m_lon(0.0)
, m_searchRadiusM(-1.0)
, m_mode(Mode::Everywhere)
, m_forceSearch(false)
, m_validPos(false)