From 6136e29e54b59b86cf3b0c4b1f6de4a564e60fb6 Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Thu, 31 May 2018 18:04:14 +0300 Subject: [PATCH] Using only real maps while checking diffs. --- storage/storage.cpp | 13 ++++++++----- storage/storage.hpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/storage/storage.cpp b/storage/storage.cpp index 20414634a3..37e821a162 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -1484,14 +1484,17 @@ void Storage::LoadDiffScheme() diffs::LocalMapsInfo localMapsInfo; auto const currentVersion = GetCurrentDataVersion(); localMapsInfo.m_currentDataVersion = currentVersion; - vector localMaps; - GetLocalMaps(localMaps); - for (auto const & map : localMaps) + + TCountriesVec localMaps; + GetLocalRealMaps(localMaps); + for (auto const & countryId : localMaps) { - auto const mapVersion = map->GetVersion(); + auto const localFile = GetLatestLocalFile(countryId); + auto const mapVersion = localFile->GetVersion(); if (mapVersion != currentVersion && mapVersion > 0) - localMapsInfo.m_localMaps.emplace(map->GetCountryName(), mapVersion); + localMapsInfo.m_localMaps.emplace(localFile->GetCountryName(), mapVersion); } + m_diffManager.AddObserver(*this); m_diffManager.Load(move(localMapsInfo)); } diff --git a/storage/storage.hpp b/storage/storage.hpp index eb68c5c75c..648d13af10 100644 --- a/storage/storage.hpp +++ b/storage/storage.hpp @@ -460,7 +460,7 @@ public: //@} /// \returns real (not fake) local maps contained in countries.txt. - /// So this method does not return custom user local maps and World and WorldCoosts country id. + /// So this method does not return custom user local maps and World and WorldCoasts country id. void GetLocalRealMaps(TCountriesVec & localMaps) const; /// Do we have downloaded countries