diff options
author | Maxim Pimenov <m@maps.me> | 2016-02-03 18:12:38 +0300 |
---|---|---|
committer | Maxim Pimenov <m@maps.me> | 2016-02-03 18:14:25 +0300 |
commit | 110919fc04803ac0860b8a366506ec084fb9e4ca (patch) | |
tree | 035df7b200f8b7099c2eb817080ef01595b9828d /search/result.cpp | |
parent | 6d52e521bc87fede597d7d89d40a32f98d3af74d (diff) |
[search] Added an event that identifies which search result was chosen.
This commit introduces a new Alohalytics event key: "searchShowResult".
Diffstat (limited to 'search/result.cpp')
-rw-r--r-- | search/result.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/search/result.cpp b/search/result.cpp index 922f9a3f28..771e1491f8 100644 --- a/search/result.cpp +++ b/search/result.cpp @@ -14,44 +14,48 @@ Result::Result(FeatureID const & id, m2::PointD const & pt, string const & str, , m_type(type) , m_featureType(featureType) , m_metadata(meta) + , m_positionInResults(-1) { Init(true /* metadataInitialized */); } Result::Result(FeatureID const & id, m2::PointD const & pt, string const & str, string const & type) - : m_id(id) - , m_center(pt) - , m_str(str) - , m_type(type) + : m_id(id), m_center(pt), m_str(str), m_type(type), m_positionInResults(-1) { Init(false /* metadataInitialized */); } -void Result::Init(bool metadataInitialized) +Result::Result(m2::PointD const & pt, string const & str, string const & region, + string const & type) + : m_center(pt), m_str(str), m_region(region), m_type(type), m_positionInResults(-1) { - // Features with empty names can be found after suggestion. - if (m_str.empty()) - m_str = m_type; - - m_metadata.m_isInitialized = metadataInitialized; } -Result::Result(m2::PointD const & pt, string const & str, - string const & region, string const & type) - : m_center(pt), m_str(str), m_region(region), m_type(type) +Result::Result(string const & str, string const & suggest) + : m_str(str), m_suggestionStr(suggest), m_positionInResults(-1) { } -Result::Result(string const & str, string const & suggest) - : m_str(str), m_suggestionStr(suggest) +Result::Result(Result const & res, string const & suggest) + : m_id(res.m_id) + , m_center(res.m_center) + , m_str(res.m_str) + , m_region(res.m_region) + , m_type(res.m_type) + , m_featureType(res.m_featureType) + , m_suggestionStr(suggest) + , m_hightlightRanges(res.m_hightlightRanges) + , m_positionInResults(-1) { } -Result::Result(Result const & res, string const & suggest) - : m_id(res.m_id), m_center(res.m_center), m_str(res.m_str), - m_region(res.m_region), m_type(res.m_type), m_featureType(res.m_featureType), - m_suggestionStr(suggest), m_hightlightRanges(res.m_hightlightRanges) +void Result::Init(bool metadataInitialized) { + // Features with empty names can be found after suggestion. + if (m_str.empty()) + m_str = m_type; + + m_metadata.m_isInitialized = metadataInitialized; } Result::ResultType Result::GetResultType() const |