mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-10 22:34:20 +00:00
[core] Add branch to place page data
Signed-off-by: eisa01 <eisa01@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
3d8a1eddc7
commit
6e8d74621f
@@ -42,7 +42,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly) BOOL isMyPosition;
|
||||
|
||||
- (instancetype)initWithTrackInfo:(TrackInfo * _Nonnull)trackInfo;
|
||||
- (void)setBranch:(NSString * _Nullable)branch;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user