From 87c2259d9c38a33df2b70fb6e21ba469832f66fe Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Sat, 23 Jan 2016 12:14:58 +0300 Subject: [PATCH] [old map downloader] Fixing assert in Storage tests. --- platform/local_country_file.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/local_country_file.cpp b/platform/local_country_file.cpp index f58ae190fa..f49d9364ce 100644 --- a/platform/local_country_file.cpp +++ b/platform/local_country_file.cpp @@ -1,4 +1,5 @@ #include "platform/local_country_file.hpp" +#include "platform/mwm_version.hpp" #include "platform/platform.hpp" #include "coding/internal/file_data.hpp" @@ -45,7 +46,10 @@ void LocalCountryFile::SyncWithDisk() void LocalCountryFile::DeleteFromDisk(MapOptions files) const { - for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting}) + vector const mapOptions = + version::IsSingleMwm(GetVersion()) ? vector({MapOptions::Map}) + : vector({MapOptions::Map, MapOptions::CarRouting}); + for (MapOptions file : mapOptions) { if (OnDisk(file) && HasOptions(files, file)) { @@ -58,7 +62,7 @@ void LocalCountryFile::DeleteFromDisk(MapOptions files) const string LocalCountryFile::GetPath(MapOptions file) const { // todo(@m): Refactor with MwmTraits after merge new-search branch. - bool singleFile = GetVersion() > 151215; + bool const singleFile = version::IsSingleMwm(GetVersion()); string const & countryFilePath = singleFile ? m_countryFile.GetNameWithExt(MapOptions::Map) : m_countryFile.GetNameWithExt(file); return my::JoinFoldersToPath(m_directory, countryFilePath);