Fixed bug with late search results after clearing.

This commit is contained in:
vng 2014-06-18 12:56:12 +03:00 committed by Alex Zolotarev
parent 6c51fe243e
commit 3d714dfbd2
2 changed files with 8 additions and 4 deletions

View file

@ -804,7 +804,7 @@ void Framework::ShowRectFixed(m2::RectD const & r)
void Framework::UpdateUserViewportChanged()
{
if (!m_lastSearch.m_query.empty())
if (IsISActive())
{
(void)GetCurrentPosition(m_lastSearch.m_lat, m_lastSearch.m_lon);
m_lastSearch.m_callback = bind(&Framework::OnSearchResultsCallback, this, _1);
@ -827,10 +827,13 @@ void Framework::OnSearchResultsCallback(search::Results const & results)
void Framework::OnSearchResultsCallbackUI(search::Results const & results)
{
m2::RectD dummy;
FillSearchResultsMarks(results, dummy);
if (IsISActive())
{
m2::RectD dummy;
FillSearchResultsMarks(results, dummy);
Invalidate();
Invalidate();
}
}
void Framework::ClearAllCaches()

View file

@ -269,6 +269,7 @@ public:
size_t ShowAllSearchResults();
void StartInteractiveSearch(search::SearchParams const & params) { m_lastSearch = params; }
bool IsISActive() const { return !m_lastSearch.m_query.empty(); }
void CancelInteractiveSearch();
/// Calculate distance and direction to POI for the given position.