forked from organicmaps/organicmaps
[ios] remove setSearchOnMap
from the MWMSearch
because the new search should always works as iPad Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
parent
5db61f0498
commit
fbc1ebd84d
3 changed files with 3 additions and 28 deletions
|
@ -191,7 +191,6 @@ BOOL defaultOrientation(CGSize const &size) {
|
|||
|
||||
- (IBAction)searchButtonTouchUpInside:(MWMButton *)sender {
|
||||
auto const body = ^(NavigationSearchState state) {
|
||||
[MWMSearch setSearchOnMap:YES];
|
||||
NSString *query = [kSearchButtonRequest.at(state) stringByAppendingString:@" "];
|
||||
NSString *locale = [[AppInfo sharedInfo] languageId];
|
||||
// Category request from navigation search wheel.
|
||||
|
|
|
@ -28,8 +28,6 @@ NS_SWIFT_NAME(Search)
|
|||
+ (NSUInteger)containerIndexWithRow:(NSUInteger)row;
|
||||
+ (SearchResult *)resultWithContainerIndex:(NSUInteger)index;
|
||||
|
||||
+ (void)setSearchOnMap:(BOOL)searchOnMap;
|
||||
|
||||
+ (NSUInteger)suggestionsCount;
|
||||
+ (NSUInteger)resultsCount;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ using Observers = NSHashTable<Observer>;
|
|||
@interface MWMSearch () <MWMFrameworkDrapeObserver>
|
||||
|
||||
@property(nonatomic) NSUInteger suggestionsCount;
|
||||
@property(nonatomic) BOOL searchOnMap;
|
||||
|
||||
@property(nonatomic) BOOL textChanged;
|
||||
|
||||
|
@ -111,16 +110,8 @@ using Observers = NSHashTable<Observer>;
|
|||
[self reset];
|
||||
if (m_query.empty())
|
||||
return;
|
||||
|
||||
if (IPAD) {
|
||||
[self searchInViewport];
|
||||
[self searchEverywhere];
|
||||
} else {
|
||||
if (self.searchOnMap)
|
||||
[self searchInViewport];
|
||||
else
|
||||
[self searchEverywhere];
|
||||
}
|
||||
[self searchInViewport];
|
||||
[self searchEverywhere];
|
||||
}
|
||||
|
||||
#pragma mark - Add/Remove Observers
|
||||
|
@ -223,18 +214,6 @@ using Observers = NSHashTable<Observer>;
|
|||
[manager reset];
|
||||
}
|
||||
|
||||
+ (void)setSearchOnMap:(BOOL)searchOnMap {
|
||||
if (IPAD)
|
||||
return;
|
||||
MWMSearch *manager = [MWMSearch manager];
|
||||
if (manager.searchOnMap == searchOnMap)
|
||||
return;
|
||||
manager.searchOnMap = searchOnMap;
|
||||
if (searchOnMap && ![MWMRouter isRoutingActive])
|
||||
GetFramework().ShowSearchResults(manager->m_everywhereResults);
|
||||
[manager update];
|
||||
}
|
||||
|
||||
+ (NSUInteger)suggestionsCount {
|
||||
return [MWMSearch manager].suggestionsCount;
|
||||
}
|
||||
|
@ -280,8 +259,7 @@ using Observers = NSHashTable<Observer>;
|
|||
- (void)processViewportChangedEvent {
|
||||
if (!GetFramework().GetSearchAPI().IsViewportSearchActive())
|
||||
return;
|
||||
if (IPAD)
|
||||
[self searchEverywhere];
|
||||
[self searchEverywhere];
|
||||
}
|
||||
|
||||
#pragma mark - Properties
|
||||
|
|
Loading…
Add table
Reference in a new issue