From d095c16b4fa9214f689e22c951bedaddad99bb43 Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Wed, 20 Apr 2016 18:17:25 +0300 Subject: [PATCH] [omim] Review fixes. --- iphone/Maps/Classes/MWMPlacePageEntity.mm | 4 ++-- map/framework.cpp | 1 - map/place_page_info.cpp | 2 +- map/place_page_info.hpp | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/iphone/Maps/Classes/MWMPlacePageEntity.mm b/iphone/Maps/Classes/MWMPlacePageEntity.mm index 5c9a2c9b26..272df0e853 100644 --- a/iphone/Maps/Classes/MWMPlacePageEntity.mm +++ b/iphone/Maps/Classes/MWMPlacePageEntity.mm @@ -148,12 +148,12 @@ void initFieldsMap() case MWMPlacePageCellTypeCoordinate: return [self coordinate]; case MWMPlacePageCellTypeAddPlaceButton: - return m_info.IsLongTap() ? @"" : nil; + return m_info.ShouldShowAddPlace() && isNewMWM ? @"" : nil; case MWMPlacePageCellTypeBookmark: return m_info.IsBookmark() ? @"" : nil; case MWMPlacePageCellTypeEditButton: // TODO(Vlad): It's a really strange way to "display" cell if returned text is not nil. - return isNewMWM && !m_info.IsMyPosition() && !m_info.GetSubtitle().empty() ? @"": nil; + return isNewMWM && !m_info.IsMyPosition() && m_info.IsFeature() ? @"": nil; case MWMPlacePageCellTypeAddBusinessButton: return m_info.IsBuilding() ? @"" : nil; default: diff --git a/map/framework.cpp b/map/framework.cpp index b4ba80b5fb..e5c116f8c1 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1891,7 +1891,6 @@ void Framework::OnTapEvent(df::TapInfo const & tapInfo) df::SelectionShape::ESelectedObject const selection = OnTapEventImpl(tapInfo, info); if (selection != df::SelectionShape::OBJECT_EMPTY) { - info.m_isLongTap = tapInfo.m_isLong; // Back up last tap event to recover selection in case of Drape reinitialization. m_lastTapEvent.reset(new df::TapInfo(tapInfo)); diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp index f537be93c4..3297a1548b 100644 --- a/map/place_page_info.cpp +++ b/map/place_page_info.cpp @@ -16,7 +16,7 @@ bool Info::IsMyPosition() const { return m_isMyPosition; } bool Info::HasApiUrl() const { return !m_apiUrl.empty(); } bool Info::IsEditable() const { return m_isEditable; } bool Info::HasWifi() const { return GetInternet() == osm::Internet::Wlan; } -bool Info::IsLongTap() const { return m_isLongTap; } +bool Info::ShouldShowAddPlace() const { return !IsFeature() || (!IsPointType() && !IsBuilding()); } string Info::FormatNewBookmarkName() const { diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp index e7f35424e6..d8a096d410 100644 --- a/map/place_page_info.hpp +++ b/map/place_page_info.hpp @@ -24,7 +24,7 @@ public: bool IsFeature() const; bool IsBookmark() const; bool IsMyPosition() const; - bool IsLongTap() const; + bool ShouldShowAddPlace() const; /// @returns true if Back API button should be displayed. bool HasApiUrl() const; /// @returns true if Edit Place button should be displayed. @@ -65,7 +65,6 @@ public: bool m_isMyPosition = false; bool m_isEditable = false; - bool m_isLongTap = false; // TODO(AlexZ): Temporary solution. It's better to use a wifi icon in UI instead of text. string m_localizedWifiString;