forked from organicmaps/organicmaps-tmp
[search] [bookmarks] Fixed the tests.
This commit is contained in:
parent
f04fb3ae6a
commit
a3712427de
7 changed files with 24 additions and 0 deletions
|
@ -145,6 +145,7 @@ UNIT_CLASS_TEST(SearchAPITest, BookmarksSearch)
|
|||
kml::SetDefaultStr(data.m_name, "Great Northern Hotel");
|
||||
kml::SetDefaultStr(data.m_description, "Clean place with a reasonable price");
|
||||
marks.emplace_back(2, data);
|
||||
m_api.EnableIndexingOfBookmarksDescriptions(true);
|
||||
m_api.OnBookmarksCreated(marks);
|
||||
m_api.OnViewportChanged(m2::RectD(-1, -1, 1, 1));
|
||||
|
||||
|
|
|
@ -390,6 +390,11 @@ void SearchAPI::FilterAllHotelsInViewport(m2::RectD const & viewport,
|
|||
m_delegate.FilterHotels(filterTasks, move(featureIds));
|
||||
}
|
||||
|
||||
void SearchAPI::EnableIndexingOfBookmarksDescriptions(bool enable)
|
||||
{
|
||||
m_engine.EnableIndexingOfBookmarksDescriptions(enable);
|
||||
}
|
||||
|
||||
void SearchAPI::OnBookmarksCreated(vector<BookmarkInfo> const & marks)
|
||||
{
|
||||
vector<BookmarkIdDoc> data;
|
||||
|
|
|
@ -144,6 +144,8 @@ public:
|
|||
void FilterAllHotelsInViewport(m2::RectD const & viewport,
|
||||
booking::filter::Tasks const & filterTasks) override;
|
||||
|
||||
void EnableIndexingOfBookmarksDescriptions(bool enable);
|
||||
|
||||
void OnBookmarksCreated(std::vector<BookmarkInfo> const & marks);
|
||||
void OnBookmarksUpdated(std::vector<BookmarkInfo> const & marks);
|
||||
void OnBookmarksDeleted(std::vector<kml::MarkId> const & marks);
|
||||
|
|
|
@ -158,6 +158,13 @@ void Engine::LoadCountriesTree()
|
|||
[](Processor & processor) { processor.LoadCountriesTree(); });
|
||||
}
|
||||
|
||||
void Engine::EnableIndexingOfBookmarksDescriptions(bool enable)
|
||||
{
|
||||
PostMessage(Message::TYPE_BROADCAST, [enable](Processor & processor) {
|
||||
processor.EnableIndexingOfBookmarksDescriptions(enable);
|
||||
});
|
||||
}
|
||||
|
||||
void Engine::OnBookmarksCreated(vector<pair<bookmarks::Id, bookmarks::Doc>> const & marks)
|
||||
{
|
||||
PostMessage(Message::TYPE_BROADCAST,
|
||||
|
|
|
@ -108,6 +108,8 @@ public:
|
|||
// Posts request to load countries tree.
|
||||
void LoadCountriesTree();
|
||||
|
||||
void EnableIndexingOfBookmarksDescriptions(bool enable);
|
||||
|
||||
void OnBookmarksCreated(std::vector<std::pair<bookmarks::Id, bookmarks::Doc>> const & marks);
|
||||
void OnBookmarksUpdated(std::vector<std::pair<bookmarks::Id, bookmarks::Doc>> const & marks);
|
||||
void OnBookmarksDeleted(std::vector<bookmarks::Id> const & marks);
|
||||
|
|
|
@ -324,6 +324,11 @@ void Processor::LoadCitiesBoundaries()
|
|||
|
||||
void Processor::LoadCountriesTree() { m_ranker.LoadCountriesTree(); }
|
||||
|
||||
void Processor::EnableIndexingOfBookmarksDescriptions(bool enable)
|
||||
{
|
||||
m_bookmarksProcessor.EnableIndexingOfDescriptions(enable);
|
||||
}
|
||||
|
||||
void Processor::OnBookmarksCreated(vector<pair<bookmarks::Id, bookmarks::Doc>> const & marks)
|
||||
{
|
||||
for (auto const & idDoc : marks)
|
||||
|
|
|
@ -94,6 +94,8 @@ public:
|
|||
void LoadCitiesBoundaries();
|
||||
void LoadCountriesTree();
|
||||
|
||||
void EnableIndexingOfBookmarksDescriptions(bool enable);
|
||||
|
||||
void OnBookmarksCreated(std::vector<std::pair<bookmarks::Id, bookmarks::Doc>> const & marks);
|
||||
void OnBookmarksUpdated(std::vector<std::pair<bookmarks::Id, bookmarks::Doc>> const & marks);
|
||||
void OnBookmarksDeleted(std::vector<bookmarks::Id> const & marks);
|
||||
|
|
Loading…
Add table
Reference in a new issue