[core] Add branch to place page data

Signed-off-by: eisa01 <eisa01@gmail.com>
This commit is contained in:
eisa01
2025-08-28 14:54:00 +02:00
committed by Konstantin Pastbin
parent 3d8a1eddc7
commit 6e8d74621f
5 changed files with 7 additions and 7 deletions

View File

@@ -42,7 +42,6 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) BOOL isMyPosition;
- (instancetype)initWithTrackInfo:(TrackInfo * _Nonnull)trackInfo;
- (void)setBranch:(NSString * _Nullable)branch;
@end

View File

@@ -59,9 +59,6 @@ static PlacePageDataSchedule convertOpeningHours(std::string_view rawOH)
return self;
}
- (void)setBranch:(NSString * _Nullable)branch {
_branch = branch;
}
@end
@@ -73,6 +70,7 @@ static PlacePageDataSchedule convertOpeningHours(std::string_view rawOH)
_title = rawData.GetTitle().empty() ? nil : @(rawData.GetTitle().c_str());
_secondaryTitle = rawData.GetSecondaryTitle().empty() ? nil : @(rawData.GetSecondaryTitle().c_str());
_subtitle = rawData.GetSubtitle().empty() ? nil : @(rawData.GetSubtitle().c_str());
_branch = rawData.GetBranch().empty() ? nil : @(rawData.GetBranch().c_str());
_secondarySubtitle = rawData.GetSecondarySubtitle().empty() ? nil : @(rawData.GetSecondarySubtitle().c_str());
if (!rawData.IsTrack()) {

View File

@@ -75,9 +75,6 @@ static PlacePageRoadType convertRoadType(RoadWarningMarkType roadType) {
}];
}
_previewData = [[PlacePagePreviewData alloc] initWithRawData:rawData()];
// Set branch from infoData to previewData
[_previewData setBranch:_infoData.branch];
auto const &countryId = rawData().GetCountryId();
if (!countryId.empty()) {

View File

@@ -97,6 +97,10 @@ void Info::SetFromFeatureType(FeatureType & ft)
m_uiSubtitle = FormatSubtitle(IsFeature() /* withTypes */, !emptyTitle /* withMainType */);
auto const branch = GetMetadata(feature::Metadata::FMD_BRANCH);
if (!branch.empty())
m_uiBranch = std::string(branch);
// apply to all types after checks
m_isHotel = ftypes::IsHotelChecker::Instance()(ft);
}

View File

@@ -121,6 +121,7 @@ public:
/// For showing in UI
std::string const & GetTitle() const { return m_uiTitle; }
std::string const & GetBranch() const { return m_uiBranch; }
/// Convenient wrapper for secondary feature name.
std::string const & GetSecondaryTitle() const { return m_uiSecondaryTitle; }
/// Convenient wrapper for type, cuisines, elevation, stars, wifi etc.
@@ -220,6 +221,7 @@ private:
/// UI
std::string m_uiTitle;
std::string m_uiBranch;
std::string m_uiSubtitle;
std::string m_uiSecondaryTitle;
std::string m_uiAddress;