diff options
author | vng <viktor.govako@gmail.com> | 2015-07-23 15:23:18 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:57:24 +0300 |
commit | 22554120649ec7f8192454692abaf2513d59e0f0 (patch) | |
tree | aaf9376a3bda97d3a1e134e2298239f473da6835 /platform | |
parent | fb3bf58d0816b09dfda925aa4340f01e82e5c724 (diff) |
[storage] Process obsolete Japan and Brazil mwm files only in root MapsWithMe folder - speeds up startup process.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/local_country_file_utils.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/platform/local_country_file_utils.cpp b/platform/local_country_file_utils.cpp index f13f4b599b..44f1f5bcd5 100644 --- a/platform/local_country_file_utils.cpp +++ b/platform/local_country_file_utils.cpp @@ -76,22 +76,25 @@ void CleanupMapsDirectory() my::DeleteFileX(my::JoinFoldersToPath(mapsDir, file)); } - // Find and remove Brazil and Japan maps. - vector<LocalCountryFile> localFiles; - FindAllLocalMaps(localFiles); - for (LocalCountryFile & localFile : localFiles) { - string const & countryName = localFile.GetCountryFile().GetNameWithoutExt(); - if (countryName == "Japan" || countryName == "Brazil") + // Delete Brazil.mwm and Japan.mwm maps, because they was replaces with + // smaler regions after osrm routing implementation. + vector<LocalCountryFile> localFiles; + FindAllLocalMapsInDirectory(mapsDir, 0 /* version */, localFiles); + for (LocalCountryFile & localFile : localFiles) { - localFile.SyncWithDisk(); - localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting); + string const & countryName = localFile.GetCountryFile().GetNameWithoutExt(); + if (countryName == "Japan" || countryName == "Brazil") + { + localFile.SyncWithDisk(); + localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting); + } } } // Try to delete empty folders. Platform::FilesList subdirs; - Platform::GetFilesByType(mapsDir, Platform::FILE_TYPE_DIRECTORY, subdirs); + platform.GetFilesByType(mapsDir, Platform::FILE_TYPE_DIRECTORY, subdirs); for (string const & subdir : subdirs) { int64_t version; |