diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-02-20 20:02:54 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2018-03-05 12:02:52 +0300 |
commit | 2c14a0617716445466dffde8c80063779d9b252c (patch) | |
tree | 21873043ddf205222e84e905d609e5cb82cf1abd /storage | |
parent | b16a1df1ef636e4c03e380f8c7eb5e80245e9516 (diff) |
Added min and max mwm version to PW
Diffstat (limited to 'storage')
-rw-r--r-- | storage/country.cpp | 3 | ||||
-rw-r--r-- | storage/storage.cpp | 21 |
2 files changed, 21 insertions, 3 deletions
diff --git a/storage/country.cpp b/storage/country.cpp index 4109846690..220ffde46c 100644 --- a/storage/country.cpp +++ b/storage/country.cpp @@ -329,9 +329,6 @@ int64_t LoadCountriesFromBuffer(string const & jsonBuffer, TCountryTree & countr { LOG(LERROR, (e.Msg())); } - stringstream ss; - ss << version; - GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapVersion, ss.str()); return version; } diff --git a/storage/storage.cpp b/storage/storage.cpp index 73709ac666..5e6f00ca7a 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -4,6 +4,7 @@ #include "defines.hpp" #include "platform/local_country_file_utils.hpp" +#include "platform/marketing_service.hpp" #include "platform/mwm_version.hpp" #include "platform/platform.hpp" #include "platform/preferred_languages.hpp" @@ -27,6 +28,8 @@ #include "std/sstream.hpp" #include "std/target_os.hpp" +#include <limits> + #include "3party/Alohalytics/src/alohalytics.h" using namespace downloader; @@ -251,6 +254,9 @@ void Storage::RegisterAllLocalMaps(bool enableDiffs) sort(localFiles.begin(), localFiles.end(), compareByCountryAndVersion); + int64_t minVersion = std::numeric_limits<int64_t>().max(); + int64_t maxVersion = std::numeric_limits<int64_t>().min(); + auto i = localFiles.begin(); while (i != localFiles.end()) { @@ -266,6 +272,16 @@ void Storage::RegisterAllLocalMaps(bool enableDiffs) LocalCountryFile const & localFile = *i; string const & name = localFile.GetCountryName(); + if (name != WORLD_FILE_NAME && name != WORLD_COASTS_FILE_NAME && + name != WORLD_COASTS_OBSOLETE_FILE_NAME) + { + auto const version = localFile.GetVersion(); + if (version < minVersion) + minVersion = version; + if (version > maxVersion) + maxVersion = version; + } + TCountryId countryId = FindCountryIdByFile(name); if (IsLeaf(countryId)) RegisterCountryFiles(countryId, localFile.GetDirectory(), localFile.GetVersion()); @@ -277,6 +293,11 @@ void Storage::RegisterAllLocalMaps(bool enableDiffs) i = j; } + GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapVersionMin, + strings::to_string(minVersion)); + GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kMapVersionMax, + strings::to_string(maxVersion)); + FindAllDiffs(m_dataDir, m_notAppliedDiffs); if (enableDiffs) LoadDiffScheme(); |