MCPcopy Create free account
hub / github.com/comaps/comaps / SaveUploadedInformation

Method SaveUploadedInformation

libs/editor/osm_editor.cpp:770–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770void Editor::SaveUploadedInformation(FeatureID const & fid, UploadInfo const & uploadInfo)
771{
772 CHECK_THREAD_CHECKER(MainThreadChecker, (""));
773
774 auto const features = m_features.Get();
775 auto editableFeatures = make_shared<FeaturesContainer>(*features);
776
777 auto id = editableFeatures->find(fid.m_mwmId);
778 // Rare case: feature was deleted at the time of changes uploading.
779 if (id == editableFeatures->end())
780 return;
781
782 auto index = id->second.find(fid.m_index);
783 // Rare case: feature was deleted at the time of changes uploading.
784 if (index == id->second.end())
785 return;
786
787 auto & fti = index->second;
788 fti.m_uploadAttemptTimestamp = uploadInfo.m_uploadAttemptTimestamp;
789 fti.m_uploadStatus = uploadInfo.m_uploadStatus;
790 fti.m_uploadError = uploadInfo.m_uploadError;
791
792 if (!NeedsUpload(uploadInfo.m_uploadStatus))
793 fti.m_object.ClearJournal();
794
795 SaveTransaction(editableFeatures);
796}
797
798bool Editor::FillFeatureInfo(FeatureStatus status, XMLFeature const & xml, FeatureID const & fid,
799 FeatureTypeInfo & fti) const

Callers

nothing calls this directly

Calls 5

NeedsUploadFunction · 0.85
ClearJournalMethod · 0.80
GetMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected