mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[core] Better check whether showing brand is redundant in subtitle
Previous implementation checked if brand was equal to name, better to check if it's located in name Signed-off-by: eisa01 <eisa01@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
fbc844b19e
commit
7088489814
@@ -165,7 +165,7 @@ std::string Info::FormatSubtitle(bool withTypes, bool withMainType) const
|
||||
auto const locBrand = platform::GetLocalizedBrandName(std::string(brand));
|
||||
|
||||
// Do not duplicate for commonly used titles like McDonald's, Starbucks, etc.
|
||||
if (locBrand != m_uiTitle && locBrand != m_uiSecondaryTitle)
|
||||
if (m_uiTitle.find(locBrand) == std::string::npos && m_uiSecondaryTitle.find(locBrand) == std::string::npos)
|
||||
append(locBrand);
|
||||
}
|
||||
|
||||
|
||||
@@ -250,10 +250,12 @@ void FillDetails(FeatureType & ft, std::string const & name, Result::Details & d
|
||||
|
||||
std::string brand{ft.GetMetadata(feature::Metadata::FMD_BRAND)};
|
||||
if (!brand.empty())
|
||||
{
|
||||
brand = platform::GetLocalizedBrandName(brand);
|
||||
|
||||
if (name == brand)
|
||||
if (name.find(brand) != std::string::npos)
|
||||
brand.clear();
|
||||
}
|
||||
|
||||
/// @todo Avoid temporary string when OpeningHours (boost::spirit) will allow string_view.
|
||||
std::string const openHours(ft.GetMetadata(feature::Metadata::FMD_OPEN_HOURS));
|
||||
|
||||
Reference in New Issue
Block a user