Search for address by special flag.

This commit is contained in:
vng 2012-12-10 16:52:57 +03:00 committed by Alex Zolotarev
parent 69682ea47e
commit 9ae450222c
4 changed files with 7 additions and 5 deletions

View file

@ -29,7 +29,8 @@ namespace search
AROUND_POSITION = 1,
IN_VIEWPORT = 2,
SEARCH_WORLD = 4,
ALL = AROUND_POSITION | IN_VIEWPORT | SEARCH_WORLD
SEARCH_ADDRESS = 8,
ALL = AROUND_POSITION | IN_VIEWPORT | SEARCH_WORLD | SEARCH_ADDRESS
};
void SetSearchMode(int mode) { m_searchMode = mode; }

View file

@ -277,7 +277,7 @@ void Engine::SearchAsync()
}
}
else
m_pQuery->Search(res);
m_pQuery->Search(res, params.NeedSearch(SearchParams::SEARCH_ADDRESS));
}
catch (Query::CancelException const &)
{

View file

@ -295,7 +295,7 @@ void Query::SearchCoordinates(string const & query, Results & res) const
}
}
void Query::Search(Results & res)
void Query::Search(Results & res, bool searchAddress)
{
ClearQueues();
@ -303,7 +303,8 @@ void Query::Search(Results & res)
SuggestStrings(res);
if (m_cancel) return;
SearchAddress();
if (searchAddress)
SearchAddress();
if (m_cancel) return;
SearchFeatures();

View file

@ -83,7 +83,7 @@ public:
/// @name Different search functions.
//@{
void SearchCoordinates(string const & query, Results & res) const;
void Search(Results & res);
void Search(Results & res, bool searchAddress);
void SearchAllInViewport(m2::RectD const & viewport, Results & res, unsigned int resultsNeeded = 30);
void SearchAdditional(Results & res, bool nearMe, bool inViewport);
//@}