From dcf987c22892eae476150b4b75bb9af061ef7e42 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Tue, 10 Jan 2017 16:13:27 +0300 Subject: [PATCH] [cleanup] [ios] Fixed unidiomatic accessor naming. --- .../Cuisine/MWMCuisineEditorViewController.h | 2 +- .../Cuisine/MWMCuisineEditorViewController.mm | 2 +- .../Maps/UI/Editor/MWMEditorViewController.mm | 2 +- .../OpeningHours/MWMOpeningHoursModel.mm | 2 +- .../OpeningHours/MWMOpeningHoursSection.h | 2 +- .../OpeningHours/MWMOpeningHoursSection.mm | 26 +++++++++---------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.h b/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.h index a718b879b0..171705fae4 100644 --- a/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.h +++ b/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.h @@ -5,7 +5,7 @@ @protocol MWMCuisineEditorProtocol -- (vector)getSelectedCuisines; +- (vector)selectedCuisines; - (void)setSelectedCuisines:(vector const &)cuisines; @end diff --git a/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.mm b/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.mm index 7f8f0a763d..5a1b4e75b2 100644 --- a/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.mm +++ b/iphone/Maps/UI/Editor/Cuisine/MWMCuisineEditorViewController.mm @@ -153,7 +153,7 @@ vector SliceKeys(vector> const & v) using namespace osm; m_allCuisines = Cuisines::Instance().AllSupportedCuisines(); m_displayedKeys = SliceKeys(m_allCuisines); - m_selectedCuisines = [self.delegate getSelectedCuisines]; + m_selectedCuisines = [self.delegate selectedCuisines]; for (auto const & s : m_selectedCuisines) { string const translated = Cuisines::Instance().Translate(s); diff --git a/iphone/Maps/UI/Editor/MWMEditorViewController.mm b/iphone/Maps/UI/Editor/MWMEditorViewController.mm index 0b3d9a9010..2a5f9d41f3 100644 --- a/iphone/Maps/UI/Editor/MWMEditorViewController.mm +++ b/iphone/Maps/UI/Editor/MWMEditorViewController.mm @@ -1041,7 +1041,7 @@ void registerCellsForTableView(vector const & cells, UITab #pragma mark - MWMCuisineEditorProtocol -- (vector)getSelectedCuisines { return m_mapObject.GetCuisines(); } +- (vector)selectedCuisines { return m_mapObject.GetCuisines(); } - (void)setSelectedCuisines:(vector const &)cuisines { m_mapObject.SetCuisines(cuisines); } #pragma mark - MWMStreetEditorProtocol diff --git a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm index 0e2ac1ce1c..8b719bfb74 100644 --- a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm +++ b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursModel.mm @@ -89,7 +89,7 @@ using namespace osmoh; } } -- (ui::TTimeTableProxy)getTimeTableProxy:(NSUInteger)index +- (ui::TTimeTableProxy)timeTableProxy:(NSUInteger)index { NSAssert(index < self.count, @"Invalid section index"); return timeTableSet.Get(index); diff --git a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.h b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.h index 23c65729a9..68342e0731 100644 --- a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.h +++ b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.h @@ -10,7 +10,7 @@ - (void)updateActiveSection:(NSUInteger)index; -- (editor::ui::TTimeTableProxy)getTimeTableProxy:(NSUInteger)index; +- (editor::ui::TTimeTableProxy)timeTableProxy:(NSUInteger)index; - (void)deleteSchedule:(NSUInteger)index; @end diff --git a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.mm b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.mm index c7a363811a..8cedd6f643 100644 --- a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.mm +++ b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursSection.mm @@ -114,7 +114,7 @@ using namespace osmoh; return cachedTime; BOOL const isClosed = [self cellKeyForRow:row] != MWMOpeningHoursEditorTimeSpanCell; - TTimeTableProxy tt = [self getTimeTableProxy]; + TTimeTableProxy tt = [self timeTableProxy]; NSUInteger const index = isClosed ? [self closedTimeIndex:row] : 0; Timespan span = isClosed ? tt.GetExcludeTime()[index] : tt.GetOpeningTime(); return dateComponentsFromTime(isStart ? span.GetStart() : span.GetEnd()); @@ -125,7 +125,7 @@ using namespace osmoh; if (!startTime && !endTime) return; - TTimeTableProxy tt = [self getTimeTableProxy]; + TTimeTableProxy tt = [self timeTableProxy]; NSUInteger const row = self.selectedRow.unsignedIntegerValue; NSUInteger const index = isClosed ? [self closedTimeIndex:row] : 0; Timespan span = isClosed ? tt.GetExcludeTime()[index] : tt.GetOpeningTime(); @@ -165,7 +165,7 @@ using namespace osmoh; - (NSUInteger)closedTimesCount { - return [self getTimeTableProxy].GetExcludeTime().size(); + return [self timeTableProxy].GetExcludeTime().size(); } - (NSUInteger)closedTimeIndex:(NSUInteger)row @@ -185,7 +185,7 @@ using namespace osmoh; NSUInteger const row = [self firstRowForKey:MWMOpeningHoursEditorAddClosedCell]; - TTimeTableProxy timeTable = [self getTimeTableProxy]; + TTimeTableProxy timeTable = [self timeTableProxy]; NSUInteger const closedTimesCountBeforeUpdate = [self closedTimesCount]; @@ -222,7 +222,7 @@ using namespace osmoh; UITableView * tableView = self.delegate.tableView; [tableView beginUpdates]; - TTimeTableProxy timeTable = [self getTimeTableProxy]; + TTimeTableProxy timeTable = [self timeTableProxy]; timeTable.RemoveExcludeTime([self closedTimeIndex:row]); timeTable.Commit(); @@ -237,7 +237,7 @@ using namespace osmoh; - (void)addSelectedDay:(Weekday)day { - TTimeTableProxy timeTable = [self getTimeTableProxy]; + TTimeTableProxy timeTable = [self timeTableProxy]; TOpeningDays openingDays(timeTable.GetOpeningDays()); openingDays.insert(day); timeTable.SetOpeningDays(openingDays); @@ -247,7 +247,7 @@ using namespace osmoh; - (void)removeSelectedDay:(Weekday)day { - TTimeTableProxy timeTable = [self getTimeTableProxy]; + TTimeTableProxy timeTable = [self timeTableProxy]; TOpeningDays openingDays(timeTable.GetOpeningDays()); openingDays.erase(day); timeTable.SetOpeningDays(openingDays); @@ -257,7 +257,7 @@ using namespace osmoh; - (BOOL)containsSelectedDay:(Weekday)day { - TTimeTableProxy timeTable = [self getTimeTableProxy]; + TTimeTableProxy timeTable = [self timeTableProxy]; TOpeningDays const & openingDays = timeTable.GetOpeningDays(); return openingDays.find(day) != openingDays.end(); } @@ -316,9 +316,9 @@ using namespace osmoh; #pragma mark - Model -- (TTimeTableProxy)getTimeTableProxy +- (TTimeTableProxy)timeTableProxy { - return [self.delegate getTimeTableProxy:self.index]; + return [self.delegate timeTableProxy:self.index]; } - (void)deleteSchedule @@ -444,7 +444,7 @@ using namespace osmoh; - (BOOL)allDay { - return [self getTimeTableProxy].IsTwentyFourHours(); + return [self timeTableProxy].IsTwentyFourHours(); } - (void)setAllDay:(BOOL)allDay @@ -456,7 +456,7 @@ using namespace osmoh; NSUInteger const deleteScheduleCellShift = self.index != 0 ? 1 : 0; NSUInteger const oldRowCount = [self numberOfRowsForAllDay:currentAllDay] - deleteScheduleCellShift; NSUInteger const newRowCount = [self numberOfRowsForAllDay:allDay] - deleteScheduleCellShift; - TTimeTableProxy timeTable = [self getTimeTableProxy]; + TTimeTableProxy timeTable = [self timeTableProxy]; timeTable.SetTwentyFourHours(allDay); timeTable.Commit(); [self refreshForNewRowCount:newRowCount oldRowCount:oldRowCount]; @@ -484,7 +484,7 @@ using namespace osmoh; - (BOOL)canAddClosedTime { - return [self getTimeTableProxy].CanAddExcludeTime(); + return [self timeTableProxy].CanAddExcludeTime(); } @end