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-09-25 19:20:39 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:43:52 +0300
commit49a7bfc73de52fa58ea972f7281ff8c970f623c8 (patch)
treeeaae93a6ea1886c768a74941d242b6c109f4fbed /search
parent41359f557a6634c6dc041113d4bc21e96ced9204 (diff)
Avoid to use heavy function languages::CurrentLanguage().
Diffstat (limited to 'search')
-rw-r--r--search/search_engine.cpp5
-rw-r--r--search/search_engine.hpp2
-rw-r--r--search/search_query.cpp5
-rw-r--r--search/search_query.hpp1
4 files changed, 13 insertions, 0 deletions
diff --git a/search/search_engine.cpp b/search/search_engine.cpp
index 737f5ee98f..4f4ef29504 100644
--- a/search/search_engine.cpp
+++ b/search/search_engine.cpp
@@ -334,6 +334,11 @@ m2::RectD Engine::GetCountryBounds(string const & file) const
return m_pData->m_infoGetter.CalcLimitRect(file);
}
+int8_t Engine::GetCurrentLanguage() const
+{
+ return m_pQuery->GetPrefferedLanguage();
+}
+
void Engine::ClearCaches()
{
/// @todo Add m_pData->m_infoGetter clearing routine.
diff --git a/search/search_engine.hpp b/search/search_engine.hpp
index 7a20b703af..7bfaea42bf 100644
--- a/search/search_engine.hpp
+++ b/search/search_engine.hpp
@@ -43,6 +43,8 @@ public:
string GetCountryFile(m2::PointD const & pt);
string GetCountryCode(m2::PointD const & pt);
+ int8_t GetCurrentLanguage() const;
+
private:
template <class T> string GetCountryNameT(T const & t);
public:
diff --git a/search/search_query.cpp b/search/search_query.cpp
index c066faf3a7..d7982d6ece 100644
--- a/search/search_query.cpp
+++ b/search/search_query.cpp
@@ -177,6 +177,11 @@ void Query::SetInputLanguage(int8_t lang)
SetLanguage(LANG_INPUT, lang);
}
+int8_t Query::GetPrefferedLanguage() const
+{
+ return GetLanguage(LANG_CURRENT);
+}
+
void Query::ClearCache()
{
for (size_t i = 0; i < RECTSCOUNT; ++i)
diff --git a/search/search_query.hpp b/search/search_query.hpp
index 575fd66567..aff43c6337 100644
--- a/search/search_query.hpp
+++ b/search/search_query.hpp
@@ -73,6 +73,7 @@ public:
void SetPreferredLanguage(string const & lang);
void SetInputLanguage(int8_t lang);
+ int8_t GetPrefferedLanguage() const;
void Search(string const & query, Results & res);
void SearchAllInViewport(m2::RectD const & viewport, Results & res, unsigned int resultsNeeded = 30);