MCPcopy Create free account
hub / github.com/comaps/comaps / StartSearchInDownloader

Method StartSearchInDownloader

qt/update_dialog.cpp:332–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void UpdateDialog::StartSearchInDownloader()
333{
334 CHECK(!m_query.empty(), ());
335
336 auto const timestamp = m_fillTreeTimestamp;
337
338 DownloaderSearchParams params{m_query, m_locale,
339 // m_onResults
340 [this, timestamp](DownloaderSearchResults const & results)
341 {
342 Filter filter;
343 for (size_t i = 0; i < results.m_results.size(); ++i)
344 {
345 auto const & res = results.m_results[i];
346 auto const added = filter.emplace(res.m_countryId, make_pair(i + 1, res.m_matchedName));
347 if (!added.second)
348 LOG(LWARNING, ("Duplicate CountryId in results for query:", results.m_query));
349 }
350
351 FillTree(filter, timestamp);
352 }};
353
354 m_framework.GetSearchAPI().SearchInDownloader(std::move(params));
355}
356
357void UpdateDialog::FillTree(optional<Filter> const & filter, uint64_t timestamp)
358{

Callers

nothing calls this directly

Calls 4

SearchInDownloaderMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected