From 1c752071cca05d155c47fc7a13637449e5d10dbf Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Thu, 1 Feb 2018 10:27:05 +0300 Subject: [PATCH] [MAPSME-6549] [ios] Added Booking support to Discovery Manager. --- iphone/Maps/Maps.xcodeproj/project.pbxproj | 12 ++ .../UI/Discovery/DiscoveryBookingCell.swift | 99 +++++++++++ .../UI/Discovery/DiscoveryBookingCell.xib | 161 ++++++++++++++++++ .../DiscoveryBookingCollectionHolderCell.xib | 71 ++++++++ .../DiscoveryCollectionHolderCell.swift | 10 +- .../DiscoveryControllerViewModel.hpp | 30 +++- .../UI/Discovery/MWMDiscoveryController.mm | 44 ++--- .../UI/Discovery/MWMDiscoveryTableManager.mm | 56 +++++- map/search_api.cpp | 4 +- map/search_api.hpp | 2 +- 10 files changed, 452 insertions(+), 37 deletions(-) create mode 100644 iphone/Maps/UI/Discovery/DiscoveryBookingCell.swift create mode 100644 iphone/Maps/UI/Discovery/DiscoveryBookingCell.xib create mode 100644 iphone/Maps/UI/Discovery/DiscoveryBookingCollectionHolderCell.xib diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index a80eedb19e..1438d8ef18 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -240,6 +240,9 @@ 34AC8FDB1EFC07FE00E7F910 /* UILabel+NumberOfVisibleLines.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AC8FD91EFC062400E7F910 /* UILabel+NumberOfVisibleLines.swift */; }; 34B1104C1FC8474D0010F76F /* CoreActionSheetPicker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B1104A1FC843420010F76F /* CoreActionSheetPicker.framework */; }; 34B127EA1FBDD410008713D9 /* MWMRouterTransitStepInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B127E81FBDD410008713D9 /* MWMRouterTransitStepInfo.mm */; }; + 34B6FD5F2015E6BF00C18E97 /* DiscoveryBookingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B6FD5D2015E6BE00C18E97 /* DiscoveryBookingCell.swift */; }; + 34B6FD602015E6BF00C18E97 /* DiscoveryBookingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34B6FD5E2015E6BF00C18E97 /* DiscoveryBookingCell.xib */; }; + 34B6FD622015F71A00C18E97 /* DiscoveryBookingCollectionHolderCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34B6FD612015F71900C18E97 /* DiscoveryBookingCollectionHolderCell.xib */; }; 34B924431DC8A29C0008D971 /* MWMMailViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B924411DC8A29C0008D971 /* MWMMailViewController.mm */; }; 34BBD6471F82649D0070CA50 /* GoogleSignIn.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 34BBD6451F8264980070CA50 /* GoogleSignIn.bundle */; }; 34BBD64C1F826DB10070CA50 /* AuthorizationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34BBD64A1F826DB10070CA50 /* AuthorizationViewController.swift */; }; @@ -1066,6 +1069,9 @@ 34B127E71FBDD410008713D9 /* MWMRouterTransitStepInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMRouterTransitStepInfo.h; sourceTree = ""; }; 34B127E81FBDD410008713D9 /* MWMRouterTransitStepInfo.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMRouterTransitStepInfo.mm; sourceTree = ""; }; 34B3806B1F1E46E20087D65B /* MWMSearchManagerState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMSearchManagerState.h; sourceTree = ""; }; + 34B6FD5D2015E6BE00C18E97 /* DiscoveryBookingCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiscoveryBookingCell.swift; sourceTree = ""; }; + 34B6FD5E2015E6BF00C18E97 /* DiscoveryBookingCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DiscoveryBookingCell.xib; sourceTree = ""; }; + 34B6FD612015F71900C18E97 /* DiscoveryBookingCollectionHolderCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DiscoveryBookingCollectionHolderCell.xib; sourceTree = ""; }; 34B924401DC8A29C0008D971 /* MWMMailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMailViewController.h; sourceTree = ""; }; 34B924411DC8A29C0008D971 /* MWMMailViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMailViewController.mm; sourceTree = ""; }; 34BBD6451F8264980070CA50 /* GoogleSignIn.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = GoogleSignIn.bundle; path = 3party/GoogleSignIn/GoogleSignIn.bundle; sourceTree = ""; }; @@ -3714,6 +3720,9 @@ F6E407CC1FC45ED4001F7821 /* Discovery */ = { isa = PBXGroup; children = ( + 34B6FD5D2015E6BE00C18E97 /* DiscoveryBookingCell.swift */, + 34B6FD5E2015E6BF00C18E97 /* DiscoveryBookingCell.xib */, + 34B6FD612015F71900C18E97 /* DiscoveryBookingCollectionHolderCell.xib */, F5BD2A86D9DA2F9769D30B54 /* DiscoveryCollectionHolderCell.swift */, F69739B41FD198E300FDA07D /* DiscoveryControllerViewModel.hpp */, F69739DA1FD6ECCE00FDA07D /* DiscoveryLocalExpertCell.swift */, @@ -4046,6 +4055,7 @@ 34D3B04B1E389D05004100F9 /* MWMNoteCell.xib in Resources */, F6E2FDEF1E097BA00083EBEC /* MWMOpeningHoursAddClosedTableViewCell.xib in Resources */, 34E50DE31F6FCBA1008EED49 /* UGCAddReviewCell.xib in Resources */, + 34B6FD602015E6BF00C18E97 /* DiscoveryBookingCell.xib in Resources */, F6E2FDF51E097BA00083EBEC /* MWMOpeningHoursAddScheduleTableViewCell.xib in Resources */, F603E05A1FDE9410006B84D6 /* DiscoveryLocalExpertCollectionHolderCell.xib in Resources */, F6E2FDFB1E097BA00083EBEC /* MWMOpeningHoursAllDayTableViewCell.xib in Resources */, @@ -4107,6 +4117,7 @@ 671182E51C7F0DDB00CB8177 /* packed_polygons_obsolete.bin in Resources */, 676507601C10559800830BB3 /* patterns.txt in Resources */, 6741A94A1BF340DE002C974C /* resources-6plus_clear in Resources */, + 34B6FD622015F71A00C18E97 /* DiscoveryBookingCollectionHolderCell.xib in Resources */, 6741A9741BF340DE002C974C /* resources-6plus_dark in Resources */, 677A2DE21C0DD50900635A00 /* resources-default in Resources */, F607C1881C032A8800B53A87 /* resources-hdpi_clear in Resources */, @@ -4239,6 +4250,7 @@ 34F4073E1E9E1AFF00E57AC0 /* MPNativeAd+MWM.mm in Sources */, F6E2FED01E097BA00083EBEC /* MWMSearchFilterViewController.mm in Sources */, 34D4FA671E265749003F53EF /* WhatsNewController.swift in Sources */, + 34B6FD5F2015E6BF00C18E97 /* DiscoveryBookingCell.swift in Sources */, 34D3B01B1E389D05004100F9 /* MWMButtonCell.mm in Sources */, 3486B5161E27AD3B0069C126 /* Framework.cpp in Sources */, 34ABA6291C2D567B00FE1BEC /* MWMInputLoginValidator.mm in Sources */, diff --git a/iphone/Maps/UI/Discovery/DiscoveryBookingCell.swift b/iphone/Maps/UI/Discovery/DiscoveryBookingCell.swift new file mode 100644 index 0000000000..46a2ea8e44 --- /dev/null +++ b/iphone/Maps/UI/Discovery/DiscoveryBookingCell.swift @@ -0,0 +1,99 @@ +@objc(MWMDiscoveryBookingCell) +final class DiscoveryBookingCell: UICollectionViewCell { + @IBOutlet private weak var avatar: UIImageView! + @IBOutlet private weak var name: UILabel! { + didSet { + name.font = UIFont.medium14() + name.textColor = UIColor.blackPrimaryText() + } + } + + @IBOutlet private weak var stars: UILabel! { + didSet { + stars.font = UIFont.regular12() + stars.textColor = UIColor.blackSecondaryText() + } + } + + @IBOutlet private weak var price: UILabel! { + didSet { + price.font = UIFont.medium14() + price.textColor = UIColor.blackSecondaryText() + } + } + + @IBOutlet private weak var rating: RatingSummaryView! { + didSet { + rating.defaultConfig() + rating.textFont = UIFont.bold12() + rating.textSize = 12 + } + } + + @IBOutlet private weak var distance: UILabel! { + didSet { + distance.font = UIFont.medium14() + distance.textColor = UIColor.linkBlue() + } + } + + @IBOutlet private weak var buildRoute: UIButton! { + didSet { + buildRoute.setTitleColor(UIColor.linkBlue(), for: .normal) + buildRoute.setTitle(L("p2p_to_here"), for: .normal) + } + } + + typealias OnBuildRoute = () -> Void + private var onBuildRoute: OnBuildRoute! + + override var isHighlighted: Bool { + didSet { + UIView.animate(withDuration: kDefaultAnimationDuration, + delay: 0, + options: [.allowUserInteraction, .beginFromCurrentState], + animations: { self.alpha = self.isHighlighted ? 0.3 : 1 }, + completion: nil) + } + } + + private func setAvatar(_ avatarURL: String?) { + guard let avatarURL = avatarURL else { return } + if !avatarURL.isEmpty, let url = URL(string: avatarURL) { + avatar.af_setImage(withURL: url, placeholderImage: #imageLiteral(resourceName: "img_localsdefault"), imageTransition: .crossDissolve(kDefaultAnimationDuration)) + } else { + avatar.image = #imageLiteral(resourceName: "img_localsdefault") + } + } + + private func setRating(_ ratingValue: String, _ ratingType: MWMRatingSummaryViewValueType) { + rating.value = ratingValue + rating.type = ratingType + } + + @objc func config(avatarURL: String?, + title: String, + subtitle: String, + price: String, + ratingValue: String, + ratingType: MWMRatingSummaryViewValueType, + distance: String, + onBuildRoute: @escaping OnBuildRoute) { + setAvatar(avatarURL) + self.name.text = title + self.stars.text = subtitle + self.price.text = price.isEmpty ? "" : "\(price) • " + setRating(ratingValue, ratingType) + self.distance.text = distance + self.onBuildRoute = onBuildRoute + } + + @IBAction private func buildRouteAction() { + onBuildRoute() + } + + override func awakeFromNib() { + super.awakeFromNib() + layer.borderColor = UIColor.blackDividers().cgColor + } +} diff --git a/iphone/Maps/UI/Discovery/DiscoveryBookingCell.xib b/iphone/Maps/UI/Discovery/DiscoveryBookingCell.xib new file mode 100644 index 0000000000..06725582f7 --- /dev/null +++ b/iphone/Maps/UI/Discovery/DiscoveryBookingCell.xib @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/UI/Discovery/DiscoveryBookingCollectionHolderCell.xib b/iphone/Maps/UI/Discovery/DiscoveryBookingCollectionHolderCell.xib new file mode 100644 index 0000000000..ffcbb51ea0 --- /dev/null +++ b/iphone/Maps/UI/Discovery/DiscoveryBookingCollectionHolderCell.xib @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift b/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift index a4be1a425f..7ce28e0c10 100644 --- a/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift +++ b/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.swift @@ -10,7 +10,7 @@ class DiscoveryCollectionHolder: UITableViewCell { @objc(MWMDiscoveryViatorCollectionHolderCell) final class DiscoveryViatorCollectionHolderCell: DiscoveryCollectionHolder { - typealias Tap = () -> () + typealias Tap = () -> Void private var tap: Tap? @objc func config(tap: @escaping Tap) { @@ -46,3 +46,11 @@ final class DiscoverySearchCollectionHolderCell: DiscoveryCollectionHolder { super.config(header: header, cellClass: DiscoverySearchCell.self) } } + +@objc(MWMDiscoveryBookingCollectionHolderCell) +final class DiscoveryBookingCollectionHolderCell: DiscoveryCollectionHolder { + @objc func config() { + super.config(header: L("discovery_button_subtitle_booking").uppercased(), + cellClass: DiscoveryBookingCell.self) + } +} diff --git a/iphone/Maps/UI/Discovery/DiscoveryControllerViewModel.hpp b/iphone/Maps/UI/Discovery/DiscoveryControllerViewModel.hpp index 1082143507..03de8f02ae 100644 --- a/iphone/Maps/UI/Discovery/DiscoveryControllerViewModel.hpp +++ b/iphone/Maps/UI/Discovery/DiscoveryControllerViewModel.hpp @@ -21,9 +21,22 @@ public: void SetSearchResults(search::Results const & res, m2::PointD const & viewportCenter, ItemType const type) { - auto & results = type == ItemType::Attractions ? m_attractions : m_cafes; - results.m_viewportCenter = viewportCenter; - results.m_results = res; + switch (type) + { + case ItemType::Attractions: + m_attractions.m_viewportCenter = viewportCenter; + m_attractions.m_results = res; + break; + case ItemType::Cafes: + m_cafes.m_viewportCenter = viewportCenter; + m_cafes.m_results = res; + break; + case ItemType::Hotels: + m_hotels.m_viewportCenter = viewportCenter; + m_hotels.m_results = res; + break; + default: break; + } } void SetViator(std::vector const & viator) { m_viator = viator; } @@ -36,8 +49,8 @@ public: case ItemType::Viator: return m_viator.size(); case ItemType::Attractions: return m_attractions.m_results.GetCount(); case ItemType::Cafes: return m_cafes.m_results.GetCount(); + case ItemType::Hotels: return m_hotels.m_results.GetCount(); case ItemType::LocalExperts: return m_experts.size(); - case ItemType::Hotels: CHECK(false, ("Discovering hotels hasn't supported yet.")); return 0; } } @@ -69,6 +82,14 @@ public: return m_experts[index]; } + search::Result const & GetHotelAt(size_t const index) const + { + CHECK_LESS(index, m_hotels.m_results.GetCount(), ("Incorrect hotels index:", index)); + return m_hotels.m_results[index]; + } + + m2::PointD const & GetHotelReferencePoint() const { return m_hotels.m_viewportCenter; } + private: struct UISearchResults { @@ -78,6 +99,7 @@ private: UISearchResults m_attractions; UISearchResults m_cafes; + UISearchResults m_hotels; std::vector m_viator; std::vector m_experts; }; diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm b/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm index d43b634608..2b5dd473e5 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm @@ -118,8 +118,9 @@ struct Callback auto getTypes = [](MWMDiscoveryMode m) -> vector { if (m == MWMDiscoveryModeOnline) - return {ItemType::Viator, ItemType::Attractions, ItemType::Cafes, ItemType::LocalExperts}; - return {ItemType::Attractions, ItemType::Cafes}; + return {ItemType::Hotels, ItemType::Viator, ItemType::Attractions, ItemType::Cafes, + ItemType::LocalExperts}; + return {ItemType::Hotels, ItemType::Attractions, ItemType::Cafes}; }; vector types = getTypes(self.mode); @@ -134,37 +135,38 @@ struct Callback #pragma mark - MWMDiscoveryTapDelegate +- (void)showSearchResult:(const search::Result &)item +{ + GetFramework().ShowSearchResult(item); + [self.navigationController popViewControllerAnimated:YES]; +} + - (void)tapOnItem:(ItemType const)type atIndex:(size_t const)index { NSString * dest = @""; switch (type) { case ItemType::Viator: - case ItemType::LocalExperts: - { - auto const & url = type == ItemType::Viator ? m_model.GetViatorAt(index).m_pageUrl - : m_model.GetExpertAt(index).m_pageUrl; - [self openUrl:[NSURL URLWithString:@(url.c_str())]]; + [self openUrl:[NSURL URLWithString:@(m_model.GetViatorAt(index).m_pageUrl.c_str())]]; + dest = kStatExternal; + break; + case ItemType::LocalExperts: + [self openUrl:[NSURL URLWithString:@(m_model.GetExpertAt(index).m_pageUrl.c_str())]]; dest = kStatExternal; break; - } case ItemType::Attractions: + [self showSearchResult:m_model.GetAttractionAt(index)]; + dest = kStatPlacePage; + break; case ItemType::Cafes: - { - auto const & item = - type == ItemType::Attractions ? m_model.GetAttractionAt(index) : m_model.GetCafeAt(index); - GetFramework().ShowSearchResult(item); - [self.navigationController popViewControllerAnimated:YES]; + [self showSearchResult:m_model.GetCafeAt(index)]; + dest = kStatPlacePage; + break; + case ItemType::Hotels: + [self showSearchResult:m_model.GetHotelAt(index)]; dest = kStatPlacePage; break; } - case ItemType::Hotels: - { - NSAssert(false, @"Discovering hotels hasn't implemented yet."); - break; - } - } - NSAssert(dest.length > 0, @""); [Statistics logEvent:kStatPlacepageSponsoredItemSelected withParameters:@{ @@ -177,7 +179,7 @@ struct Callback - (void)routeToItem:(ItemType const)type atIndex:(size_t const)index { - CHECK(type == ItemType::Attractions || type == ItemType::Cafes, + CHECK(type == ItemType::Attractions || type == ItemType::Cafes || type == ItemType::Hotels, ("Attempt to route to item with type:", static_cast(type))); auto const & item = type == ItemType::Attractions ? m_model.GetAttractionAt(index) : m_model.GetCafeAt(index); diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm index 1a094845ed..0b1bc94e9c 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm @@ -37,7 +37,7 @@ NSString * StatProvider(ItemType const type) case ItemType::LocalExperts: return kStatLocalsProvider; case ItemType::Attractions: return kStatSearchAttractions; case ItemType::Cafes: return kStatSearchRestaurants; - case ItemType::Hotels: ASSERT(false, ()); return @""; + case ItemType::Hotels: return kStatBooking; } } } // namespace discovery @@ -179,6 +179,7 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) [tv registerWithCellClass:[MWMDiscoverySearchCollectionHolderCell class]]; [tv registerWithCellClass:[MWMDiscoveryViatorCollectionHolderCell class]]; [tv registerWithCellClass:[MWMDiscoveryLocalExpertCollectionHolderCell class]]; + [tv registerWithCellClass:[MWMDiscoveryBookingCollectionHolderCell class]]; [tv registerWithCellClass:[MWMDiscoveryNoResultsCell class]]; } @@ -240,6 +241,19 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) return cell; } +- (MWMDiscoveryBookingCollectionHolderCell *)bookingCollectionHolderCell:(NSIndexPath *)indexPath +{ + Class cls = [MWMDiscoveryBookingCollectionHolderCell class]; + auto cell = static_cast( + [self.tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); + auto collection = static_cast(cell.collectionView); + [cell config]; + collection.delegate = self; + collection.dataSource = self; + collection.itemType = ItemType::Hotels; + return cell; +} + #pragma mark - UITableViewDataSource - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section @@ -297,11 +311,7 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) } return [self searchCollectionHolderCell:indexPath]; } - case ItemType::Hotels: - { - CHECK(false, ("Discovering hotels hasn't implemented yet.")); - return nil; - } + case ItemType::Hotels: return [self bookingCollectionHolderCell:indexPath]; } } @@ -351,7 +361,6 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) }]; return cell; } - case ItemType::Viator: { Class cls = [MWMViatorElement class]; @@ -394,7 +403,38 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) }]; return cell; } - case ItemType::Hotels: NSAssert(false, @""); return nil; + case ItemType::Hotels: + { + Class cls = [MWMDiscoveryBookingCell class]; + auto cell = static_cast( + [collectionView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); + auto const & sr = model.GetHotelAt(indexPath.row); + auto const & pt = model.GetHotelReferencePoint(); + + NSMutableString * subtitle = nil; + auto starsCount = sr.GetStarsCount(); + if (starsCount == 0) + { + subtitle = [@(sr.GetFeatureTypeName().c_str()) mutableCopy]; + } + else + { + subtitle = [@"" mutableCopy]; + for (int i = 0; i < starsCount; ++i) + [subtitle appendString:@"★"]; + } + [cell configWithAvatarURL:nil + title:@(sr.GetString().c_str()) + subtitle:[subtitle copy] + price:@(sr.GetHotelApproximatePricing().c_str()) + ratingValue:@(sr.GetHotelRating().c_str()) + ratingType:MWMRatingSummaryViewValueTypeGood + distance:@(GetDistance(pt, sr.GetFeatureCenter()).c_str()) + onBuildRoute:^{ + [self.delegate routeToItem:type atIndex:indexPath.row]; + }]; + return cell; + } } } diff --git a/map/search_api.cpp b/map/search_api.cpp index d6b6318101..890efbcea0 100644 --- a/map/search_api.cpp +++ b/map/search_api.cpp @@ -226,7 +226,7 @@ bool SearchAPI::SearchInViewport(ViewportSearchParams const & params) return Search(p, false /* forceSearch */); } -bool SearchAPI::SearchForDiscovery(DiscoverySearchParams const & params) +void SearchAPI::SearchForDiscovery(DiscoverySearchParams const & params) { CHECK(params.m_onResults, ()); CHECK(!params.m_query.empty(), ()); @@ -258,7 +258,7 @@ bool SearchAPI::SearchForDiscovery(DiscoverySearchParams const & params) } }; - return Search(p, false /* forceSearch */); + GetEngine().Search(p); } bool SearchAPI::SearchInDownloader(storage::DownloaderSearchParams const & params) diff --git a/map/search_api.hpp b/map/search_api.hpp index e3cd8c900a..06af3d9da2 100644 --- a/map/search_api.hpp +++ b/map/search_api.hpp @@ -112,7 +112,7 @@ public: // Search in the viewport. bool SearchInViewport(search::ViewportSearchParams const & params); - bool SearchForDiscovery(search::DiscoverySearchParams const & params); + void SearchForDiscovery(search::DiscoverySearchParams const & params); // Search for maps by countries or cities. bool SearchInDownloader(storage::DownloaderSearchParams const & params);