diff --git a/indexer/map_object.cpp b/indexer/map_object.cpp index 27a455b332..a84bad7526 100644 --- a/indexer/map_object.cpp +++ b/indexer/map_object.cpp @@ -70,6 +70,7 @@ FeatureID const & MapObject::GetID() const { return m_featureID; } ms::LatLon MapObject::GetLatLon() const { return MercatorBounds::ToLatLon(m_mercator); } m2::PointD const & MapObject::GetMercator() const { return m_mercator; } feature::TypesHolder const & MapObject::GetTypes() const { return m_types; } + string MapObject::GetDefaultName() const { string name; @@ -95,6 +96,7 @@ vector MapObject::AvailableProperties() const string MapObject::GetPhone() const { return m_metadata.Get(feature::Metadata::FMD_PHONE_NUMBER); } string MapObject::GetFax() const { return m_metadata.Get(feature::Metadata::FMD_FAX_NUMBER); } string MapObject::GetEmail() const { return m_metadata.Get(feature::Metadata::FMD_EMAIL); } + string MapObject::GetWebsite() const { string website = m_metadata.Get(feature::Metadata::FMD_WEBSITE); @@ -129,12 +131,14 @@ vector MapObject::GetCuisines() const } string MapObject::FormatCuisines() const { return strings::JoinStrings(GetCuisines(), " • "); } + string MapObject::GetOpeningHours() const { return m_metadata.Get(feature::Metadata::FMD_OPEN_HOURS); } string MapObject::GetOperator() const { return m_metadata.Get(feature::Metadata::FMD_OPERATOR); } + int MapObject::GetStars() const { // Most popular case. @@ -162,7 +166,9 @@ string MapObject::GetElevation() const } string MapObject::GetWikipediaLink() const { return m_metadata.GetWikiURL(); } + string MapObject::GetFlats() const { return m_metadata.Get(feature::Metadata::FMD_FLATS); } + string MapObject::GetBuildingLevels() const { return m_metadata.Get(feature::Metadata::FMD_BUILDING_LEVELS); diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index 778f05a804..9fb7069bdc 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -849,7 +849,6 @@ NewFeatureCategories Editor::GetNewFeatureCategories() const } sort(res.m_allSorted.begin(), res.m_allSorted.end(), [](Category const & c1, Category const & c2) { - // TODO(AlexZ): Does it sort correctly? return c1.m_name < c2.m_name; }); // TODO(mgsergio): Store in Settings:: recent history of created types and use them here. @@ -869,6 +868,7 @@ namespace FeatureID GenerateNewFeatureId(FeatureID const & oldFeatureId) { // TODO(AlexZ): Stable & unique features ID generation. + // TODO(vng): Looks like new feature indexes should uninterruptedly continue after existing indexes in mwm file. static uint32_t newIndex = 0x0effffff; return FeatureID(oldFeatureId.m_mwmId, newIndex++); } diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 42d0beff6e..7f63b5e3d4 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -2,7 +2,6 @@ #include "geometry/rect2d.hpp" -// TODO(AlexZ): Integrate editable feature into an editor. #include "indexer/editable_map_object.hpp" #include "indexer/feature.hpp" #include "indexer/feature_meta.hpp" @@ -135,6 +134,7 @@ private: struct FeatureTypeInfo { FeatureStatus m_status; + // TODO(AlexZ): Integrate EditableMapObject class into an editor instead of FeatureType. FeatureType m_feature; /// If not empty contains Feature's addr:street, edited by user. string m_street; diff --git a/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm b/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm index 57d1b0d375..f31253b616 100644 --- a/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm +++ b/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm @@ -6,7 +6,6 @@ #include "indexer/cuisines.hpp" #include "std/algorithm.hpp" -#include "std/set.hpp" namespace { diff --git a/iphone/Maps/Classes/Editor/MWMEditorViewController.mm b/iphone/Maps/Classes/Editor/MWMEditorViewController.mm index c3fe63c43b..ec8046dc71 100644 --- a/iphone/Maps/Classes/Editor/MWMEditorViewController.mm +++ b/iphone/Maps/Classes/Editor/MWMEditorViewController.mm @@ -182,9 +182,8 @@ NSString * reuseIdentifier(MWMPlacePageCellType cellType) case MWMPlacePageCellTypeName: return m_mapObject.IsNameEditable(); case MWMPlacePageCellTypeStreet: return m_mapObject.IsAddressEditable(); case MWMPlacePageCellTypeBuilding: return m_mapObject.IsAddressEditable(); - default: NSAssert(false, @"Invalid cell type %d", cellType); + default: NSAssert(false, @"Invalid cell type %d", cellType); return false; } - return false; } - (void)configTable diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h index 42669e885f..9cf1b380ad 100644 --- a/iphone/Maps/Classes/MapViewController.h +++ b/iphone/Maps/Classes/MapViewController.h @@ -15,7 +15,6 @@ namespace search { struct AddressInfo; } @interface MapViewController : MWMViewController { CGPoint m_popoverPos; - LocationPredictor * m_predictor; } diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index fa510ccd8c..bf17d403da 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -822,7 +822,7 @@ NSString * const kEditorSegue = @"Map2EditorSegue"; { UINavigationController * dvc = segue.destinationViewController; MWMEditorViewController * editorVC = (MWMEditorViewController *)[dvc topViewController]; - [editorVC setFeatureToEdit:((MWMPlacePageEntity *)sender).featureID]; + [editorVC setFeatureToEdit:static_cast(sender).featureID]; } else if ([segue.identifier isEqualToString:kAuthorizationSegue]) { diff --git a/map/framework.cpp b/map/framework.cpp index f9c4725b6d..f0ba67a53c 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1775,7 +1775,7 @@ void Framework::OnTapEvent(df::TapInfo const & tapInfo) // Back up last tap event to recover selection in case of Drape reinitialization. m_lastTapEvent.reset(new df::TapInfo(tapInfo)); - { + { // Log statistics event. ms::LatLon const ll = info.GetLatLon(); double myLat, myLon; double metersToTap = -1; @@ -1851,7 +1851,6 @@ df::SelectionShape::ESelectedObject Framework::OnTapEventImpl(df::TapInfo const FillBookmarkInfo(*static_cast(mark), FindBookmark(mark), outInfo); break; case UserMark::Type::SEARCH: - // TODO(AlexZ): Check if search results features are correcly passed to UI. FillApiMarkInfo(*static_cast(mark), outInfo); break; default: diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp index d8906d9f34..ef28012446 100644 --- a/map/place_page_info.cpp +++ b/map/place_page_info.cpp @@ -14,6 +14,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; } + string Info::FormatNewBookmarkName() const { string const title = GetTitle(); diff --git a/qt/editor_dialog.cpp b/qt/editor_dialog.cpp index 79a18d5b11..0eaa975d63 100644 --- a/qt/editor_dialog.cpp +++ b/qt/editor_dialog.cpp @@ -114,18 +114,18 @@ EditorDialog::EditorDialog(QWidget * parent, osm::EditableMapObject & emo) case osm::Props::Email: v = emo.GetEmail(); break; case osm::Props::Website: v = emo.GetWebsite(); break; case osm::Props::Internet: - { - grid->addWidget(new QLabel(kInternetObjectName), row, 0); - QComboBox * cmb = new QComboBox(); - string const values[] = {DebugPrint(osm::Internet::Unknown), DebugPrint(osm::Internet::Wlan), - DebugPrint(osm::Internet::Wired), DebugPrint(osm::Internet::Yes), - DebugPrint(osm::Internet::No)}; - for (auto const & v : values) - cmb->addItem(v.c_str()); - cmb->setCurrentText(DebugPrint(emo.GetInternet()).c_str()); - cmb->setObjectName(kInternetObjectName); - grid->addWidget(cmb, row++, 1); - } + { + grid->addWidget(new QLabel(kInternetObjectName), row, 0); + QComboBox * cmb = new QComboBox(); + string const values[] = {DebugPrint(osm::Internet::Unknown), DebugPrint(osm::Internet::Wlan), + DebugPrint(osm::Internet::Wired), DebugPrint(osm::Internet::Yes), + DebugPrint(osm::Internet::No)}; + for (auto const & v : values) + cmb->addItem(v.c_str()); + cmb->setCurrentText(DebugPrint(emo.GetInternet()).c_str()); + cmb->setObjectName(kInternetObjectName); + grid->addWidget(cmb, row++, 1); + } continue; case osm::Props::Cuisine: v = strings::JoinStrings(emo.GetCuisines(), ", "); break; case osm::Props::OpeningHours: v = emo.GetOpeningHours(); break; @@ -181,12 +181,14 @@ void EditorDialog::OnSave() } m_feature.SetName(names); } + if (m_feature.IsAddressEditable()) { m_feature.SetHouseNumber(findChild(kHouseNumberObjectName)->text().toStdString()); m_feature.SetStreet(findChild(kStreetObjectName)->currentText().toStdString()); m_feature.SetPostcode(findChild(kPostcodeObjectName)->text().toStdString()); } + for (osm::Props const prop : m_feature.GetEditableProperties()) { if (prop == osm::Props::Internet) @@ -205,9 +207,11 @@ void EditorDialog::OnSave() m_feature.SetInternet(v); continue; } + QLineEdit * editor = findChild(QString::fromStdString(DebugPrint(prop))); if (!editor) continue; + string const v = editor->text().toStdString(); switch (prop) {