forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
b0e0fa8a87
commit
1bb30fc057
4 changed files with 6 additions and 13 deletions
|
@ -1390,10 +1390,7 @@ bool Framework::SearchInViewport(search::ViewportSearchParams const & params)
|
|||
std::string query = params.m_query;
|
||||
strings::Trim(query);
|
||||
strings::AsciiToLower(query);
|
||||
if (query == "cian")
|
||||
m_cianSearchMode = true;
|
||||
else
|
||||
m_cianSearchMode = false;
|
||||
m_cianSearchMode = (query == "cian");
|
||||
}
|
||||
|
||||
search::SearchParams p;
|
||||
|
|
|
@ -339,10 +339,7 @@ Geocoder::~Geocoder() {}
|
|||
void Geocoder::SetParams(Params const & params)
|
||||
{
|
||||
m_params = params;
|
||||
if (m_params.m_cianMode)
|
||||
m_model.EnableCian();
|
||||
else
|
||||
m_model.DisableCian();
|
||||
m_model.SetCianEnabled(m_params.m_cianMode);
|
||||
|
||||
m_tokenRequests.clear();
|
||||
m_prefixTokenRequest.Clear();
|
||||
|
|
|
@ -107,10 +107,10 @@ SearchModel::SearchType SearchModel::GetSearchType(FeatureType const & feature)
|
|||
static auto const & localityChecker = IsLocalityChecker::Instance();
|
||||
static auto const & poiChecker = IsPoiChecker::Instance();
|
||||
|
||||
if (m_cianMode && cianChecker(feature))
|
||||
if (m_cianEnabled && cianChecker(feature))
|
||||
return SEARCH_TYPE_BUILDING;
|
||||
|
||||
if (!m_cianMode && buildingChecker(feature))
|
||||
if (!m_cianEnabled && buildingChecker(feature))
|
||||
return SEARCH_TYPE_BUILDING;
|
||||
|
||||
if (streetChecker(feature))
|
||||
|
|
|
@ -49,11 +49,10 @@ public:
|
|||
|
||||
SearchType GetSearchType(FeatureType const & feature) const;
|
||||
|
||||
void EnableCian() { m_cianMode = true; }
|
||||
void DisableCian() { m_cianMode = false; }
|
||||
void SetCianEnabled(bool enabled) { m_cianEnabled = enabled; }
|
||||
|
||||
private:
|
||||
bool m_cianMode = false;
|
||||
bool m_cianEnabled = false;
|
||||
};
|
||||
|
||||
string DebugPrint(SearchModel::SearchType type);
|
||||
|
|
Loading…
Add table
Reference in a new issue