Review fixes.

This commit is contained in:
Yuri Gorshenin 2016-03-02 16:04:43 +03:00 committed by Sergey Yershov
parent 60302cc600
commit 6677a5ae64
6 changed files with 7 additions and 8 deletions

View file

@ -187,7 +187,7 @@ extern "C"
params.SetInputLocale(ReplaceDeprecatedLanguageCode(jni::ToNativeString(env, lang)));
params.SetForceSearch(true);
params.SetMode(search::Mode::World);
params.DisableSuggests();
params.SetSuggestsEnabled(false);
params.m_onResults = bind(&OnResults, _1, timestamp, false /* isMapAndTable */, false /* hasPosition */, 0.0, 0.0);
g_framework->NativeFramework()->Search(params);

View file

@ -134,7 +134,7 @@ using namespace storage;
{
__weak auto weakSelf = self;
m_searchParams.SetMode(search::Mode::World);
m_searchParams.DisableSuggests();
m_searchParams.SetSuggestsEnabled(false);
m_searchParams.m_onResults = ^(search::Results const & results)
{
__strong auto self = weakSelf;

View file

@ -43,9 +43,8 @@ namespace search
/// @param[in] locale can be "fr", "en-US", "ru_RU" etc.
inline void SetInputLocale(string const & locale) { m_inputLocale = locale; }
inline void DisableSuggests() { m_suggestsEnabled = false; }
inline void EnableSuggests() { m_suggestsEnabled = true; }
inline bool SuggestsEnabled() const { return m_suggestsEnabled; }
inline void SetSuggestsEnabled(bool enabled) { m_suggestsEnabled = enabled; }
inline bool GetSuggestsEnabled() const { return m_suggestsEnabled; }
bool IsEqualCommon(SearchParams const & rhs) const;

View file

@ -294,7 +294,7 @@ void Engine::DoSearch(SearchParams const & params, m2::RectD const & viewport,
processor.SetPosition(viewport.Center());
processor.SetMode(params.GetMode());
processor.EnableSuggests(params.SuggestsEnabled());
processor.SetSuggestsEnabled(params.GetSuggestsEnabled());
// This flag is needed for consistency with old search algorithm
// only. It will be gone when we remove old search code.

View file

@ -353,7 +353,7 @@ UNIT_CLASS_TEST(SearchQueryV2Test, DisableSuggests)
params.m_query = "londo";
params.m_inputLocale = "en";
params.SetMode(search::Mode::World);
params.DisableSuggests();
params.SetSuggestsEnabled(false);
TestSearchRequest request(m_engine, params, m_viewport);
request.Wait();

View file

@ -91,7 +91,7 @@ public:
inline void SetMode(Mode mode) { m_mode = mode; }
inline void SetSearchInWorld(bool b) { m_worldSearch = b; }
inline void EnableSuggests(bool enabled) { m_suggestsEnabled = enabled; }
inline void SetSuggestsEnabled(bool enabled) { m_suggestsEnabled = enabled; }
/// Suggestions language code, not the same as we use in mwm data
int8_t m_inputLocaleCode, m_currentLocaleCode;