Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/search
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-12-10 17:52:57 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:47:29 +0300
commit9ae450222c678bfdc53136db7fbd61cd401768f4 (patch)
treea661b0aa8c1422a53b872a3319a9558c4f2bbc23 /search
parent69682ea47e2876e48d93ae823899752f1956194a (diff)
Search for address by special flag.
Diffstat (limited to 'search')
-rw-r--r--search/params.hpp3
-rw-r--r--search/search_engine.cpp2
-rw-r--r--search/search_query.cpp5
-rw-r--r--search/search_query.hpp2
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);
//@}