Skip to content

Commit

Permalink
Revert "[placepage] Show all types"
Browse files Browse the repository at this point in the history
This reverts commit 10b01c9.

Signed-off-by: Harry Bond <[email protected]>
  • Loading branch information
RedAuburn authored and biodranik committed May 31, 2024
1 parent e783bad commit 4ed22bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
23 changes: 1 addition & 22 deletions indexer/map_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ std::string_view MapObject::GetPostcode() const
return m_metadata.Get(MetadataID::FMD_POSTCODE);
}

std::string MapObject::GetLocalizedType() const
string MapObject::GetLocalizedType() const
{
ASSERT(!m_types.Empty(), ());
feature::TypesHolder copy(m_types);
Expand All @@ -94,27 +94,6 @@ std::string MapObject::GetLocalizedType() const
return platform::GetLocalizedTypeName(classif().GetReadableObjectName(copy.GetBestType()));
}

std::string MapObject::GetAllLocalizedTypes() const
{
ASSERT(!m_types.Empty(), ());
feature::TypesHolder copy(m_types);
copy.SortBySpec();

std::ostringstream oss;
bool first = true;
for (auto const type : copy)
{
if (!first)
oss << feature::kFieldsSeparator;
first = false;

auto localizedType = platform::GetLocalizedTypeName(classif().GetReadableObjectName(type));
oss << localizedType;
}

return oss.str();
}

std::string_view MapObject::GetMetadata(MetadataID type) const
{
return m_metadata.Get(type);
Expand Down
5 changes: 1 addition & 4 deletions indexer/map_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ class MapObject
void AssignMetadata(feature::Metadata & dest) const { dest = m_metadata; }

protected:
/// @returns "the best" single type to display in UI.
/// @returns "the best" type to display in UI.
std::string GetLocalizedType() const;

/// @returns all types separated by kFieldsSeparator to display in UI.
std::string GetAllLocalizedTypes() const;

FeatureID m_featureID;
m2::PointD m_mercator;
Expand Down
2 changes: 1 addition & 1 deletion map/place_page_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ std::string Info::FormatSubtitle(bool withType) const
append(m_bookmarkCategoryName);

if (withType)
append(GetAllLocalizedTypes());
append(GetLocalizedType());

// Flats.
auto const flats = GetMetadata(feature::Metadata::FMD_FLATS);
Expand Down

0 comments on commit 4ed22bd

Please sign in to comment.