From 9ae450222c678bfdc53136db7fbd61cd401768f4 Mon Sep 17 00:00:00 2001 From: vng Date: Mon, 10 Dec 2012 16:52:57 +0300 Subject: [PATCH] Search for address by special flag. --- search/params.hpp | 3 ++- search/search_engine.cpp | 2 +- search/search_query.cpp | 5 +++-- search/search_query.hpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/search/params.hpp b/search/params.hpp index 2b8b338f6a..a1b1918915 100644 --- a/search/params.hpp +++ b/search/params.hpp @@ -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; } diff --git a/search/search_engine.cpp b/search/search_engine.cpp index ea110df8e7..70bcf4a9d2 100644 --- a/search/search_engine.cpp +++ b/search/search_engine.cpp @@ -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 &) { diff --git a/search/search_query.cpp b/search/search_query.cpp index c79ba0f6c3..26c96451c9 100644 --- a/search/search_query.cpp +++ b/search/search_query.cpp @@ -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(); diff --git a/search/search_query.hpp b/search/search_query.hpp index 5b1d9d0925..a62de5ee47 100644 --- a/search/search_query.hpp +++ b/search/search_query.hpp @@ -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); //@}