[new downloader] Review fixes affter PR with interface of new search in downloader.

This commit is contained in:
Vladimir Byko-Ianko 2016-03-23 11:07:35 +03:00 committed by Sergey Yershov
parent 8b539a04a3
commit 06fc4a40b5
2 changed files with 24 additions and 25 deletions

View file

@ -1095,7 +1095,7 @@ bool Framework::SearchInDownloader(DownloaderSearchParams const & params)
TCountryId const & countryId = CountryInfoGetter().GetRegionCountryId(mercator);
if (countryId == kInvalidCountryId)
continue;
downloaderSearchResults.m_vec.emplace_back(countryId, it->GetString() /* m_matchedName */);
downloaderSearchResults.m_results.emplace_back(countryId, it->GetString() /* m_matchedName */);
}
downloaderSearchResults.m_endMarker = results.IsEndMarker();
params.m_onResults(downloaderSearchResults);

View file

@ -8,34 +8,33 @@
namespace storage
{
struct DownloaderSearchResult
{
DownloaderSearchResult(TCountryId const & countryId, string const & matchedName)
: m_countryId(countryId), m_matchedName(matchedName) {}
struct DownloaderSearchResult
{
DownloaderSearchResult(TCountryId const & countryId, string const & matchedName)
: m_countryId(countryId), m_matchedName(matchedName) {}
TCountryId m_countryId;
/// \brief |m_matchedName| is a name of found feature in case of searching in World.mwm
/// and is a local name of mwm (group or leaf) in case of searching in country tree.
string m_matchedName;
};
TCountryId m_countryId;
/// \brief |m_matchedName| is a name of found feature in case of searching in World.mwm
/// and is a local name of mwm (group or leaf) in case of searching in country tree.
string m_matchedName;
};
struct DownloaderSearchResults
{
DownloaderSearchResults()
: m_endMarker(false) {}
struct DownloaderSearchResults
{
DownloaderSearchResults() : m_endMarker(false) {}
vector<DownloaderSearchResult> m_vec;
/// \brief |m_endMarker| == true if it's the last call of TOnResults callback for the search.
/// Otherwise |m_endMarker| == false.
bool m_endMarker;
};
vector<DownloaderSearchResult> m_results;
/// \brief |m_endMarker| == true if it's the last call of TOnResults callback for the search.
/// Otherwise |m_endMarker| == false.
bool m_endMarker;
};
struct DownloaderSearchParams
{
using TOnResults = function<void (DownloaderSearchResults const &)>;
struct DownloaderSearchParams
{
TOnResults m_onResults;
string m_query;
string m_inputLocale;
};
TOnResults m_onResults;
string m_query;
string m_inputLocale;
};
} // namespace storage