diff --git a/editor/xml_feature.hpp b/editor/xml_feature.hpp index 07d06484f9..1643b2bf47 100644 --- a/editor/xml_feature.hpp +++ b/editor/xml_feature.hpp @@ -74,6 +74,7 @@ public: uint32_t GetOffset() const; void SetOffset(uint32_t featureOffset); + /// @returns my::INVALID_TIME_STAMP if there were no any upload attempt. time_t GetUploadTime() const; void SetUploadTime(time_t const time); diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index acead90ba2..238560fec7 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -239,6 +239,7 @@ void Editor::LoadMapEdits() fti.m_feature = FeatureType::FromXML(xml); fti.m_feature.SetID(fid); fti.m_modificationTimestamp = xml.GetModificationTime(); + ASSERT_NOT_EQUAL(my::INVALID_TIME_STAMP, fti.m_modificationTimestamp, ()); fti.m_uploadAttemptTimestamp = xml.GetUploadTime(); fti.m_uploadStatus = xml.GetUploadStatus(); fti.m_uploadError = xml.GetUploadError(); @@ -280,8 +281,9 @@ void Editor::Save(string const & fullFilePath) const FeatureTypeInfo const & fti = offset.second; XMLFeature xf = fti.m_feature.ToXML(); xf.SetOffset(offset.first); + ASSERT_NOT_EQUAL(0, fti.m_modificationTimestamp, ()); xf.SetModificationTime(fti.m_modificationTimestamp); - if (fti.m_uploadAttemptTimestamp) + if (fti.m_uploadAttemptTimestamp != my::INVALID_TIME_STAMP) { xf.SetUploadTime(fti.m_uploadAttemptTimestamp); ASSERT(!fti.m_uploadStatus.empty(), ("Upload status updates with upload timestamp.")); diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 20dbc97ca9..a89c30c308 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -7,6 +7,8 @@ #include "editor/xml_feature.hpp" +#include "base/timer.hpp" + #include "std/ctime.hpp" #include "std/function.hpp" #include "std/map.hpp" @@ -85,8 +87,8 @@ private: { FeatureStatus m_status; FeatureType m_feature; - time_t m_modificationTimestamp = 0; - time_t m_uploadAttemptTimestamp = 0; + time_t m_modificationTimestamp = my::INVALID_TIME_STAMP; + time_t m_uploadAttemptTimestamp = my::INVALID_TIME_STAMP; /// "" | "ok" | "repeat" | "failed" string m_uploadStatus; string m_uploadError;