From 89a7e22666beecd370df6aba3417f8c513d4f539 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sat, 16 Jan 2016 21:29:33 +0300 Subject: [PATCH] [editor] Print features count in log. Correct TODO code. --- indexer/osm_editor.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index a320454343..a3b647be6e 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -271,18 +271,15 @@ void Editor::LoadMapEdits() FeatureTypeInfo & fti = m_features[id][fid.m_index]; - /// TODO(mgsergio): uncomment when feature creating will - /// be required - // if (xml.GetType() != XMLFeature::Type::Way) - // { - // TODO(mgsergio): Check if feature can be read. - fti.m_feature = *m_featureLoaderFn(fid); - fti.m_feature.ApplyPatch(xml); - // } - // else - // { - // fti.m_feature = FeatureType::FromXML(xml); - // } + if (section.first == FeatureStatus::Created) + { + // TODO(mgsergio): Create features which are not present in mwm. + } + else + { + fti.m_feature = *m_featureLoaderFn(fid); + fti.m_feature.ApplyPatch(xml); + } fti.m_feature.SetID(fid); fti.m_street = xml.GetTagValue(kAddrStreetTag); @@ -293,6 +290,13 @@ void Editor::LoadMapEdits() fti.m_uploadStatus = xml.GetUploadStatus(); fti.m_uploadError = xml.GetUploadError(); fti.m_status = section.first; + switch (section.first) + { + case FeatureStatus::Deleted: ++deleted; break; + case FeatureStatus::Modified: ++modified; break; + case FeatureStatus::Created: ++created; break; + case FeatureStatus::Untouched: ASSERT(false, ()); break; + } } catch (editor::XMLFeatureError const & ex) {