Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2018-02-20 20:02:54 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2018-03-05 12:02:52 +0300
commit2c14a0617716445466dffde8c80063779d9b252c (patch)
tree21873043ddf205222e84e905d609e5cb82cf1abd
parentb16a1df1ef636e4c03e380f8c7eb5e80245e9516 (diff)
Added min and max mwm version to PW
-rw-r--r--platform/marketing_service.cpp3
-rw-r--r--platform/marketing_service.hpp3
-rw-r--r--storage/country.cpp3
-rw-r--r--storage/storage.cpp21
4 files changed, 25 insertions, 5 deletions
diff --git a/platform/marketing_service.cpp b/platform/marketing_service.cpp
index 5b02fa75ea..4f059efe63 100644
--- a/platform/marketing_service.cpp
+++ b/platform/marketing_service.cpp
@@ -4,7 +4,8 @@ namespace marketing
{
// Tags.
-char const * const kMapVersion = "map_version";
+char const * const kMapVersionMin = "map_version_min";
+char const * const kMapVersionMax = "map_version_max";
char const * const kMapListing = "map_listing";
char const * const kMapDownloadDiscovered = "map_download_discovered";
char const * const kMapLastDownloaded = "last_map_downloaded";
diff --git a/platform/marketing_service.hpp b/platform/marketing_service.hpp
index bac4604c80..c2b7dc275f 100644
--- a/platform/marketing_service.hpp
+++ b/platform/marketing_service.hpp
@@ -9,7 +9,8 @@
namespace marketing
{
// Tags.
-extern char const * const kMapVersion;
+extern char const * const kMapVersionMin;
+extern char const * const kMapVersionMax;
extern char const * const kMapListing;
extern char const * const kMapDownloadDiscovered;
extern char const * const kMapLastDownloaded;
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();